Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OS X: sending mail to localhost

Tags:

email

macos

For testing purposes I want send mail to my localhost user account rather than my webserver. I am unsure how to do this using mail.app. Any help would be appreciated.

like image 232
Ronn Avatar asked Dec 30 '08 00:12

Ronn


People also ask

Can I send email using localhost?

You can send mail from localhost with sendmail package , sendmail package is inbuild in XAMPP. So if you are using XAMPP then you can easily send mail from localhost. For example, you can configure C:\xampp\php\php. ini and c:\xampp\sendmail\sendmail.

How do I run SMTP server on Mac?

To change these preferences in the Mail app on your Mac, choose Mail > Preferences, click Accounts, click Server Settings, click the outgoing Account pop-up menu, then choose Edit SMTP Server List. The servers available to you and the accounts that are using them. Add or remove a server.


1 Answers

@Tautologistics

OSX does have a built-in MTA (SMTP server), to turn it on you can type:

sudo launchctl start org.postfix.master   

then you can send mail to localhost like you desire


sample showing an SMTP server running from my machine running 10.6.1

>telnet 127.0.0.1 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host

>sudo launchctl start org.postfix.master

>telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 machinename.example.com ESMTP Postfix
like image 128
Ryan Horrisberger Avatar answered Jan 03 '23 14:01

Ryan Horrisberger