oshirowanen
oshirowanen

Reputation: 15945

Receive an email from someone to localhost using PHP

I have a question about receiving emails.

Using Ubuntu as the server, I have setup simple mail sending capabilities using the following command line:

sudo tasksel mail-server

This allows me to send emails using the command line:

echo 'body' | sendmail [email protected]

or the following in PHP:

mail($to, $subj, $msg)

Then [email protected] receives the email no problem.

The email comes from oshirowanen@desktop

If [email protected] sends an email back to oshirowanen@desktop, how do I receive it on the localhost from the command prompt or php?

Upvotes: 0

Views: 204

Answers (2)

colonelclick
colonelclick

Reputation: 2215

oshirowanen@desktop is not a fully formed email address, and cannot be replied to by anyone from the internet. In order to receive email to a domain, you generally need to register a domain, then you can set it up to use your ubuntu server as a mail exchanger or smtp client if you wish.

Upvotes: 0

contrid
contrid

Reputation: 980

Well, localhost is local so you'll need a fixed IP and a nameserver for your computer and propagate that domain to your computer so it can receive emails over the internet.

Upvotes: 0

Related Questions