How to setup an SMTP server on Mac OS X?
Solution 1
The following did the job. See source here.
- Edit file:
sudo emacs /System/Library/LaunchDaemons/org.postfix.master.plist
. - Add
<key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>
before the closing</dict>
tag. - Run
sudo postfix start
.
Check that SMPT is running: telnet localhost 25
Solution 2
Option 1:
CommandLineFu had this one liner to run an SMTP server on port 25:
sudo python -m smtpd -n -c DebuggingServer localhost:25
This will run a fake smtp server on your local machine. It won't send anything, but will dump it to the console.
Option 2:
Incase, you are not comfortable with command line then FakeSMTP is a Free Fake SMTP Server with GUI for testing emails in applications easily. It is written in Java. It is very nice and easy to use.
[http://nilhcem.com/FakeSMTP/][1]
![0x90](https://i.stack.imgur.com/xlhE1.jpg?s=256&g=1)
0x90
echo \[q\]sa\[ln0=aln256%Pln256/snlbx\]sb3135071790101768542287578439snlbxq|dc
Updated on October 08, 2020Comments
-
0x90 over 3 years
I work with PHP and I have mamp on my machine. I would like to send emails within my PHP code:
<?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?>
How can I configure a mail server for free on my mac machine ?
-
Ameed Aabidi over 6 yearsEven though I'm across after a long time, please update the source. It seems to not work.
-
AlikElzin-kilaka over 6 yearsSyed, I didn't write the missing article. Feel free finding a replacement source.
-
micseydel over 5 yearsI didn't have that file, although I did have /System/Library/LaunchDaemons/com.apple.postfix.master.plist It didn't have edit permission so I tried just starting the service, which seemed to work by itself.
-
Vladtn over 3 yearsThis is brilliant