Page 1 of 1

Problem Sending Mail!

Posted: Fri Nov 07, 2003 10:41 am
by whci98
Hi,
I'm trying to use the mail() function but I'm have problems. I very new to PHP. Below is my PHP code and the error I get when I run it. Do I need to get SMTP port number from somewhere? please help :(

Code: Select all

<?php

mail("nouman@rogers.com", "My Subject", "Line 1\nLine 2\nLine 3");

?>
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

Posted: Fri Nov 07, 2003 11:27 am
by Weirdan
Your php is set to use localhost as mailserver, but you have not mailserver at your host. Do you use some sort of Win as your OS?

Posted: Fri Nov 07, 2003 11:32 am
by whci98
I'm using Win XP Pro.

Posted: Fri Nov 07, 2003 11:38 am
by Weirdan
then edit php.ini. replace lines

Code: Select all

SMTP = localhost
;sendmail_from = me@localhost.com
with

Code: Select all

SMTP = mail_server_of_your_ISP_here
sendmail_from = your_email_here