Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPMailer and Style Sheet formatting
    text
    copied!<p>I'm using PHPMailer to automatically send an order acknowledgement as an HTML formatted email. Everything is working as expected except that the formatting of the acknowledgement isn't correct. I included my style sheet with an 'AddAttachment' line which seems to have fixed the header of the acknowledgement form, but the rest of the form still isn't right. Has anyone run into this situation before and know what I need to do to fix it? My edited program code follows in case it'll help!</p> <pre><code>&lt;?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail-&gt;SMTPDebug = 0; $mail-&gt;IsSMTP(); // telling the class to use SMTP $mail-&gt;SMTPAuth = true; $mail-&gt;Port = 25; // set the SMTP port $mail-&gt;Host = "&lt;&lt;smtp server&gt;&gt;"; // SMTP server $mail-&gt;Username = "&lt;&lt;username&gt;&gt;"; $mail-&gt;Password = "&lt;&lt;password&gt;&gt;"; $mail-&gt;From = "&lt;&lt;email address&gt;&gt;"; $mail-&gt;FromName = "&lt;&lt;name&gt;&gt;"; $mail-&gt;AddAddress("&lt;&lt;email address&gt;&gt;"); $mail-&gt;Subject = "Acknowledgement Form"; $mail-&gt;AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail-&gt;IsHTML(true); $mail-&gt;Body = file_get_contents('&lt;&lt;acknowledgement form page&gt;&gt;'); $mail-&gt;AddAttachment('printer.css'); // attach style sheet if(!$mail-&gt;Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail-&gt;ErrorInfo; } else { echo 'Message has been sent.'; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload