Why does mail() work on LOCALHOST on my MAC but not my PC ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bilko123
Forum Newbie
Posts: 1
Joined: Sun May 06, 2012 12:17 pm

Why does mail() work on LOCALHOST on my MAC but not my PC ?

Post by Bilko123 »

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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Why does mail() work on LOCALHOST on my MAC but not my P

Post by requinix »

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?
Post Reply