I am trying to use the mail() function. However get this error on execution:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in E:\domains\n\mywebsite.co.uk\user\htdocs\test.php on line 1
I am currently using fasthosts as my web hosting service. Because of this i can't access the php.ini file to make the necessary changes.
Hi, Thanks for your response. But when i run it with From header i get this error:
Warning: mail() [function.mail]: SMTP server response: 554 <tom@email.co.uk>: Recipient address rejected: Relay access denied in E:\domains\n\mywebsite.co.uk\user\htdocs\test.php on line 3
Most likely your mail server is not set up correctly for your current needs. It seems like the mail script is not authenticating properly. You'll either need to configure your smtp server or else use a different one (both of which I believe are out of the scope of PHP's mail function but don't quote me on that as I use the PEAR Mail class instead - which incidentally would probably help you out if you dont want to muck about with your local mail server).
how to set the SMTP server in php...
i get this warnin when i try to send mail
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 D:\xampp\htdocs\pro_php\register.php on line 60
Bookmarks