I have a fairly basic php/mysql website running on LOCALHOST on my Apple MAC. I use the mail() function to send emails, and this works fine on the MAC.
I copied over the website to my PC Laptop which uses WAMP Server. Everything works OK apart from when I try to send emails. It appears that my ISP (BTInternet here in the UK) requires SMTP authentication. My question is why does it work on my MAC but not on my PC?
F.Y.I.
On my PC I initially got this error message:
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
so I used ini_set as follows:
ini_set("SMTP","mail.btinternet.com");
ini_set("smtp_port","25");
ini_set('sendmail_from', 'admin@mywebsitedomain.com');
Then I get the message:
SMTP server response: 530 authentication required - Your email could not be sent. To fix this you must make a simple change to your email (known as SMTP authentication). For advice visit http://www.btyahoo.com/smtp
Why does mail() work on LOCALHOST on my MAC but not my PC ?
Moderator: General Moderators
Re: Why does mail() work on LOCALHOST on my MAC but not my P
It worked because your Mac wasn't using your ISP's email server. It has its own software to send emails.
Your PC does not. Did you go to the website in the error message?
Your PC does not. Did you go to the website in the error message?