English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am currently sending out a news letter in a plain text email because I haven't gotten the HTML format to work yet.

However, when I send out the message, the formatting seems to get screwed up depending on what mail servers it goes through. Some people receive it as one solid block of text with no line breaks. Others receive it as intended. And other receive it with multiple line breaks where only one was intended.

Is there any way to get consistency with the message formatting?

Also, when the PHP script is taking information from a text fields, does it automatically put "\r" characters at any carriage returns?

2007-10-31 03:33:09 · 1 answers · asked by Justin H 7 in Computers & Internet Programming & Design

1 answers

For really nicely formatted messages see this article
http://www.zend.com/zend/spotlight/sendmimeemailpart1.php?article=sendmimeemailpart1&kind=sl&id=888&open=1&anc=0&view=1

That will help with consistency and even HTML formats.

For plain text mail be sure to include wordwrap option
http://www.php.net/function.mail

has the details.

Also NOTE THIS INFORMATION
Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.

For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages.

----- that is from the function mail info.

And the \r is NOT automatically added but can be by some mail systems so it can be very problematic!
Note:
Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.

Hope that helps a little.

2007-10-31 03:46:31 · answer #1 · answered by Tracy L 7 · 0 0

fedest.com, questions and answers