Hi,

I'm sending customers a confirmation email of their orders on our site.

The email is in plain text and has 4 columns - Item, Color, Quantity, Price, Subtotal.

Now it took me a while to make sure they're all perfectly aligned (with whitespaces between the columns so they are spaced out), and each text of a column is not too long (truncate it in that case)...
On my test server when I send those confirmation emails as a test they looked perfect in MS Outlook...

Now that the site is online and we test preview those plain text message in Yahoo or Hotmail Accounts, the text/columns are totally out of sync...

If sent in utf-8, they ignore if there is more then one whitespace after the words...

If sent in iso-8859-1, some (extra) whitespaces are in place - but not all of them, still the matrix is out of sync...

I know that it is possible though, as the confirmation emails I've been getting from Amazon.com for example are in plain text and the matrix (columns) work and are aligned.

How do I do that ?

Btw, I am using the standard php mail() function.

Thanx for your help in advance !!!

Mike

    Check my post on the other forum you posted this to. 😉

      Would you mind re-posting the answer as it seems the thread was deleted/removed.

        Ya know, most email client programs leave HTML rendering on these days (they just prevent external images from loading.) Issues with fonts etc, will make your goal nearly impossible for everyone. Why not just send the email as HTML?

          bretticus wrote:

          Ya know, most email client programs leave HTML rendering on these days (they just prevent external images from loading.) Issues with fonts etc, will make your goal nearly impossible for everyone. Why not just send the email as HTML?

          I always send in both formats. Why not? Conversion can be automated to do a pretty good job of approximating most of the emails I send out -- especially if I just create 2 versions. Something like this:

                    require_once 'PEAR/Mail.php';
                    require_once 'PEAR/Mail/mimePart.php';
                    require_once 'PEAR/Mail/mime.php';
                    $crlf = "\r\n";
                    $hdrs = array('From'    => 'from@domain.com',
                                           'Subject' => $subject);
          
                $mime = new Mail_mime($crlf);
          
                $mime->setTXTBody($text_body);
                $mime->setHTMLBody($html_body);
          
                $body = $mime->get();
                $hdrs = $mime->headers($hdrs);
          
                $mail =& Mail::factory('mail');
                $mail->send($recipient_email, $hdrs, $body);
          

          It never hurts to put a thing at the top that links to a webpage where the email can be viewed directly. I've seen plenty of companies do that -- can even make it disappear with pure CSS.

            I always send in both formats. Why not? Conversion can be automated to do a pretty good job of approximating most of the emails I send out -- especially if I just create 2 versions. Something like this:

            Sending a multipart with both html and txt is fine with me too. However, the issue is trying to make columns line up with dynamic content using spaces and dealing with different email readers. Seems like unnecessary pain and suffering to me.

              Write a Reply...