Hi I have a simple mail function which works perfectly on a linux server, but not on a windows. <?php $to = 'info@servername.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email]welcome@servername.com[/email]' . "\r\n" . 'Reply-To: [email]welcome@servername.com[/email]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> PHP: can anyone help me to work the mail function on windows. Thanks
hey, i'm not very skilled with this function, but i'm using it quite often... try replacing [email]email[/email] PHP: with <email>... pls let me know...
mail function should work on IIS(or windows) too...if and only if you have an SMTP server ready to handle your outgoing mail request.
check your mail server log to see if the mail is being rejected. If there's no sign of your mail then at least you know the problem lies with your php code. Very often your smpt settings require outbound authentication and you may not be passing this in your script.
I was able to get PHP mail to work under Windows by editing the following lines in the php.ini file and then restarting Apache: SMTP = mail.my_isp_smtp_server.com smtp_port = 25
U might have to configure SMTP on windows server. So that this mail function will start working on windows as well. Mayur.
you must install apache server on you windows which one you use and then you install mail server system.
You may use the SMTP authentication to send mail through PHP script. Some hosting providers do not allow to send mail through script with out SMTP authentication. You may use the phpmailer script to send mail through PHP script. For more info on this go to http://phpmailer.sourceforge.net/ Kailash