Reseller Hosting, Shared Hosting, Dedicated Hosting by Vortech Inc.

Go Back   Reseller Hosting, Shared Hosting, Dedicated Hosting by Vortech Inc. > >> General Public > Chit Chat Public
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Chit Chat Public Talk about any thing you want! This forum is public.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-24-2002, 12:24 PM
cericksen
Guest
 
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
Reply With Quote
  #2  
Old 12-22-2002, 11:11 PM
resellme
Guest
 
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-22-2002 at 11:48 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP on Windows Server cjmelhorn Chit Chat Public 3 10-26-2003 10:19 PM


All times are GMT -5. The time now is 12:16 PM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Vortech Inc. ©2005
Page generated in 0.24338 seconds with 13 queries
[Output: 36.05 Kb. compressed to 34.01 Kb. by saving 2.04 Kb. (5.65%)]