![]() |
|
|||||||
| Chit Chat Public Talk about any thing you want! This forum is public. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
#1
|
|||||||||||
|
|||||||||||
|
PHP and Mail() on a Windows Server
Posting to a wider audience.....
I know that someone has asked this before but I can't seem to find the answer. I am trying to use the mail() function in PHP on a windows server and get an error. I have put my own php.ini file in my root directory and have used phpinfo() to make sure that's the file it's using. I also verified that the correct mail server is being used. I moved this script over to a unix server and it seems to work fine....any ideas or tips would be MUCH appreciated. Here is the portion of the script I get errors on: $message = "Name: $Name\nCompany: $Company\nPhone: $Phone\nEmail: $Email\nOrder: $Order\n"; $extra = "From: $Name\r\nReply-To: $Email\r\n"; mail ("chris@ericksen.org", "Website Email", $message, $extra); //This is where I have the error -- mail() echo "<p class=bodymd>Thanks for your inguiry, $Name.</p>"; echo "<p class=bodymd>A response will be sent to $Email as soon as possible.</p>"; } Here is the SMTP line in PHP.INI SMTP = mail.ala.clesystems.com |
|
#2
|
|||||||||||
|
|||||||||||
|
Try replacing all your \n in your $message variable to \r\n instead. That should work. You might also want to include some added headers to prevent picky mail servers from not delivering your message. I have included the ones I use below.
I hope this helps Regards Nik $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; //use text/html to send html formated messages $headers .= "From: Name<webmaster@domain.com>\r\n"; $headers .= "Reply-To: <webmaster@domain.com>\r\n"; $headers .= "X-Sender: <webmaster@domain.com>\r\n"; $headers .= "X-Mailer: PHP4\r\n"; //mailer $headers .= "X-Priority: 3\r\n"; //1 UrgentMessage, 3 Normal $headers .= "Return-Path: <webmaster@domain.com>\r\n"; mail($email,$subject,wordwrap(stripslashes($messag e),75,"\r\n",1),$headers); Last edited by resellme : 12-23-2002 at 12:48 AM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FTP on Windows Server | cjmelhorn | Chit Chat Public | 3 | 10-26-2003 11:19 PM |