Page 1 of 1

email

Posted: Mon Jan 15, 2007 12:01 pm
by sweetcoz
hi everyone,
my php.ini mail section is setup as follows:

Code: Select all

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
then in my php script:

Code: Select all

mail("joecool@hotmail.com", "Testing", "Line 1\nLine 2\nLine 3", "From: tom@hotmail.com") or die("email error");
but i keep getting this error:
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() in C:\Program Files\xampp\htdocs\test.php on line 2

on all tutorials that i went, the mail fucntion is written this way
what is wrong?

Posted: Mon Jan 15, 2007 12:40 pm
by jayshields
Do you have an SMTP server set up on localhost? If not, that's why it's failing...