php - add inline image to a message sent with swiftmailer -
Please forgive my php, but, I am using Swift Mailer to send emails from a customer website. They have requested to add an image or two as signature etc. and therefore are watching swiftmonder specs here
They suggest adding an inline image like this
$ message-> Message- & gt; Embed (SWIFT_IZEZ :: Separation ('http: //site.tld/image here'))Or in this way (in 2 steps)
$ Cid = $ message- & gt; Embed (SWIFT_IZEZ :: Separation ('image here'));
then in the Email body section
Tried both the steps but it is of no avail. When I press the send email button, I get this error which I do not know what to do about it.
/ home / content / 78/5152878 / html / 4testing / erase / ask-doc-proc2.php on line 89 in a member function
I was already working directly in code and email only one thing image code was directly in email this error clearly from the examples in the docs pages If I remove it, then this email sends right away. Since I need to add a picture for this,
Any help is greatly appreciated. Thanks. >
Edit: This is the part where the email has been created and sent $ cid = $ message- & gt; embed (swift_imbedded file :: );
-> Settau ($ docEmail) -> Setbodie ("Hello". "\ R \ n \ r \ n". $ Fullname. " Is my journey At the time, he has requested to know more about the test. \ R \ n \ r \ n "." Foreclaims To know more about breast health testing, please visit www.ClarityWomensHealth.com, or call our customer at support line 1 (877) 722-6339. \ R \ n \ r \ n "." We look forward to hearing from you. \ R \ n \ r \ n "." Thanks, ", 'Text / Field') - & gt; Adpart (" Hello "., & Lt; / b & gt; & lt; br / & gt;
< ; B & gt; "$ Purnnam." & Lt; / b & gt; On their visit to www.MyForeCYTE.com, they have requested to know more about the exam. & Lt; br / & gt; "." To know more about foreclose breast health test, please visit www.ClarityWomensHealth.com or call our customer support line at 1 (877) 722-633 9.
"We are looking forward To listen to you.
$ Cid. " 'Alt =' pic '/ & gt;". "Thank you", "text / html');
After finding me, an alternative solution was found in Swiftmailer. In which only one work is done.
is an embed function (
and the other is an attached function
So for the above code, I removed "Embed" Because it was not working for me and added these 2 lines below and it works
-> Attach (swift_uppressive :: to path ('path here.jpg' for image) -> Set despction ('inline'));
and it works 100%
Comments
Post a Comment