5.7.x - Send Mail attachment / Zend Mailer Class -> setType
Permalink
Hi
In Concrete5.6.x we could use the Zend Mailer Class and had access to setType. Add Attachement, etc.. It was possible to set Mime type and trough this to add an attachment to a mail that existed as a string.
I don't need or want to create a file object to add an attachment. I just want to create one from the raw data. Is that not possible anymore in 5.7?
Methods in 5.6 ->http://docs.mnkras.com/class_zend___mail.html...
Methods in 5.7 ->https://concrete5.org/api/class-Concrete.Core.Mail.Service.html...
In Concrete5.6.x we could use the Zend Mailer Class and had access to setType. Add Attachement, etc.. It was possible to set Mime type and trough this to add an attachment to a mail that existed as a string.
I don't need or want to create a file object to add an attachment. I just want to create one from the raw data. Is that not possible anymore in 5.7?
Methods in 5.6 ->http://docs.mnkras.com/class_zend___mail.html...
Methods in 5.7 ->https://concrete5.org/api/class-Concrete.Core.Mail.Service.html...
Thanks for this!
Also, I just found this:
http://documentation.concrete5.org/developers/sending-mail/working-...
It was probably non existent at the time you wrote you post.
Also, I just found this:
http://documentation.concrete5.org/developers/sending-mail/working-...
It was probably non existent at the time you wrote you post.
Basically, just ignore the implementation of concrete5 and use directly Zend Mailer.
At the top of your block/single page, set the following use statements:
Then where you want to send the message:
This works out of the box if you give a correct mail address and correct attachment. Needs still some fine tuning, but overall it does the job.