Send attachment in mail

sbhadauria
@sbhadauria
6 years ago
129 posts
How we can send attachment through jrCore_send_email function?
updated by @sbhadauria: 05/11/18 05:35:38PM
brian
@brian
6 years ago
10,144 posts
The fourth parameter to the jrCore_send_email function is an "options" array - you can send attachments by including them in the "attachments" key for the options array - i.e.

$_options = array(
    'attachments' => array(
        '/full/path/to/attachment1',
        '/full/path/to/attachment2'
    )
);
jrCore_send_email(address, 'subject', 'message', $_options);

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
lets go
@devcentricbeats
6 years ago
118 posts
@brian are you referring to the jrcore include.php to be edited
updated by @devcentricbeats: 02/09/18 02:17:34AM
sbhadauria
@sbhadauria
6 years ago
129 posts
Hi @brian sorry for late reply I have tried but your code is not working.
sbhadauria
@sbhadauria
6 years ago
129 posts
When I have changed Active Email System from MailGun Email API to SMTP server configured and save SMTP delivery setting then attachment code is working.
So for attachment we have to save SMTP settings?
brian
@brian
6 years ago
10,144 posts
You will want to use the local SMTP server - not the Mailgun Email API.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
6 years ago
10,144 posts
And note that you can continue to use Mailgun via local SMTP - i.e.:

https://community.rackspace.com/products/f/email-products-forum/3897/how-to-setup-postfix-with-a-mailgun-smtp-relay-when-using-multiple-domains


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sbhadauria
@sbhadauria
6 years ago
129 posts
I want to use the Mailgun API but is it necessary to set delivery settings for attachments?

Tags