Problems sending HTML mail to some recipients

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tuleby
Forum Newbie
Posts: 2
Joined: Thu Aug 10, 2006 2:54 pm

Problems sending HTML mail to some recipients

Post 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]
tuleby
Forum Newbie
Posts: 2
Joined: Thu Aug 10, 2006 2:54 pm

Case solved :)

Post 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 :)
Post Reply