Forum Moderators: coopster
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
then in my php script:
<?php
mail("joecool@hotmail.com", "Testing", "Line 1\nLine 2\nLine 3", "From: tom@hotmail.com") or die("email error");
?>
i have also run mercury mail but i keep getting this error:
Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\Program Files\xampp\htdocs\test.php on line 2
on all tutorials that i went, the mail function is written this way
what is wrong?
please try to understand these settings:
SMTP = localhost
smtp_port = 25
it says that php will try to use Localhost(the computer on which the script is being run from) to send email using smtp port.
In your case your server is not configured as a SMTP server. You will either have to install a SMTP server, like how we install Apache,IIS and others as web servers.
Please note even IIS can act as a smtp server but tehre are many of them available for free.
Also SMTP server usally run on port 25.
If you do not have the SMTP server installed on your PC you will have to upload it on the production server, usally all hosting providers have SMTP. So if you will run the script on the server it will surely send the emails.
Hope this helps,
Thanks
bye