Cannot send mail from localhost.

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
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Cannot send mail from localhost.

Post by klevis miho »

How to make my localhost a smtp server?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Cannot send mail from localhost.

Post by social_experiment »

XAMMP has a mail server option (no idea how to set it up though) :/
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Cannot send mail from localhost.

Post by klevis miho »

Yeah, I saw the option, Mercury mail server, but I didn't know how to set it up.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Cannot send mail from localhost.

Post by social_experiment »

Setting+up+XAMPP+mercury+mail+server
The first link looks like it might be helpful :)
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Cannot send mail from localhost.

Post by klevis miho »

Yes, I saw this, but I wanted to discuss it here :)
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Cannot send mail from localhost.

Post by social_experiment »

Good point.

I got it working using the default settings. After you have created a new user you simply add the account to something like Outlook and then check your mail as normal. This is for sending mail using mail().
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Cannot send mail from localhost.

Post by klevis miho »

Thank you, I will check that out and tell you.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Cannot send mail from localhost.

Post by klevis miho »

Ok, after just starting the Mercury service, I test the email from a php script:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry.

This error shows up.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Cannot send mail from localhost.

Post by klevis miho »

I did the steps provided in this blog:

http://www.danieltmurphy.com/setting-up-mercury-smtp/

The error got away, and I see in "Mercury Core Process": To: myemail@gmail.com (non-local) OK.
However, I haven't received any email in myemail@gmail.com
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Cannot send mail from localhost.

Post by social_experiment »

I haven't tried sending to a non-local address but to a local one (user@localhost) it works ok
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply