Page 1 of 1

Problems sending HTML mail to some recipients

Posted: Thu Aug 10, 2006 2:59 pm
by tuleby
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi!

I have a problem sending emails from a server using PHP

We developed a site and hosted it on a shared web server for a few months. 
Everything worked fine then, but now we have moved the website no a new server at http://www.offshore-web-hosts.com/

We send mail via a PHP script, with the following headers

Code: Select all

$strHeaders = "From: \"SNG invest\" <info@snginvest.com>\r\n";
    $strHeaders .= "Reply-To: info@snginvest.com\r\n";
    $strHeaders .= "MIME-Version: 1.0\r\n";
    $strHeaders .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    $strHeaders .= "X-Priority: 3\r\n";
    $strHeaders .= "X-MSMail-Priority: Normal\r\n";
    $strHeaders .= "X-Mailer: PHP/". phpversion() ."\r\n";
Most member reciev HTML mail perfectly OK, but quite many of our members (for example all with Google Mail /gmail) recieve a few headers and all the code in raw HTML, like this

Code: Select all

Content-Type: text/html; charset=ISO-8859-1
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: PHP/4.3.10

This did not happen when we used our previous server (IIS on Windows with PHP 4.3.6)

The old server was IIS on Windows with PHP 4.3.6

The new server is Apache on Linux with PHP 4.3.10
The configuration can be seen on
http://www.snginvest.com/phptest.php


Any ideas why it is like this :?:

We have a test script on the new server if you would like to try
http://www.snginvest.com/mail_test.php

Code can be seen at
http://www.snginvest.com/mail_test.php.txt

Thanks


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Case solved :)

Posted: Fri Aug 11, 2006 4:50 am
by tuleby
I was told Winows uses \r\n but Unix uses only \n

I changed all of these and now it´s wokring fine :)