I am using the email modules in Drumple to send e-mails with attachments. E-mails are sent correctly, but there are no attachments. This is the code that I use (I have enabled the module now):
$ sender = 'mycompany @ company Com '; $ Recipient = 'myemail@mail.com'; $ Theme = 'new command'; $ Body = 'Please, look at the attachment.'; $ Plaintext = TRUE; $ Headers = array (); $ Attachments [] = array ('file path' = & gt; 'invoice / sample.pdf', 'filetime' => 'application / pdf',); Email ($ Sender, $ Recipient, $ Theme, $ Body, $ Plain Text, $ Header, $ Text = Null, $ Attachments, $ Mailkey); To ensure that the path of the PDF attachment is correct, I have written this line to download the attachment from the browser and it works.
header ('location: invoice / sample .pdf'); In addition, I have tried this alternative code but still nothing ...
$ file = new stdClass (); $ File- & gt; Filename = 'sample.pdf'; $ File- & gt; File path = 'invoice / sample.pdf'; $ File- & gt; Filemime = 'Application / PDF'; Email ($ sender, $ recipient, subject $ $, $ plain text, $ header, $ text = tap, array ($ file), $ mailkey); ps I do not think so, but maybe because my hosting has not allowed to send attachments? Thank you
Two problem reports have been opened for mime mail modules.
In these, the OP reports that the specified attachment does not work using the full path; In this issue, it is suggested to change the code
with the attachment from the header ('location: invoice / sample .pdf') to resolve this issue. to send an email; $ Sender = 'mycompany@company.com'; $ Recipient = 'myemail@email.com'; $ Theme = 'new command'; $ Body = 'Please, look at the attachment.'; $ Plaintext = TRUE; $ Headers = array (); $ Attachments [] = array ('file path' = & gt; 'invoice / sample.pdf', 'filetime' => Mime / type); Email ($ Sender, $ Recipient, $ Theme, $ Body, $ Plain Text, $ Header, $ Text = Null, $ Attachments, $ Mailkey); From to
header ('location: invoice / sample .pdf'); $ Sender = 'mycompany@company.com'; $ Recipient = 'myemail@email.com'; $ Theme = 'new command'; $ Body = 'Please, look at the attachment.'; $ Plaintext = TRUE; $ Headers = array (); $ Attachments [] = array ('file path' = 'gtc:' invoice / sample.pdf ',' filemime '= & gt;' mime / type ',' filename '=>' sample.pdf ',' list '= & Gt; true;); Email ($ Sender, $ Recipient, $ Theme, $ Body, $ Plain Text, $ Header, $ Text = Null, $ Attachments, $ Mailkey); In , OP reports that attachments are not shown when using SMTP; In the same report, another user reports that he is not using SMTP, but the etchamment is not shown when the e-mail is sent through the rules.
Comments
Post a Comment