First of all, hi
With SwiftMailer, I send HTML + PLAIN emails.
In Outlook, when displaying this email as plain text, this is not my simple text part, but an automated parsed version of HTML.
Does anyone know how to get Outlook to use the text / open part of a message when displaying plain text?
My code does the following:
$plain_body = convert_html_to_text($body); $message->setBody($body, 'text/html') ->addPart($plain_body, 'text/plain');
$body has some formats and images:
vardump($body); <html> <head>...</head> <body> <img src="logo.png" alt="Company name" /><br /> <img src="border.png" alt="border" /><br /> <img src="face.png" alt="Mr Somebody" /><br /> <p>Hello Ninj! You requested a confirmation by email...</p> <img src="footer.png" alt="footer" /> </body></html>
$plain_body contains very clean text (thanks to javon):
vardump($plain_body); "Hello Ninj! You requested a confirmation by email..."
But in the text version viewed in Outlook, I see instead all the alt pics attributes of the HTML version, one line at a time, then slightly slightly formatted text:
The name of the company
Border
Mr Somebody
Hi Ninh!
You have requested confirmation by email ...
footer
Thank you for helping anyone who can help :)
outlook plaintext
Ninj Oct 02 '13 at 11:03
source share