I am writing a Bash shell script for Mac that sends an email notification by opening an automator application that sends email out with the default mail account in Mail.app. The
There is a program called Sendmail.
You probably don't want to use the -bs
command unless you are sending it as raw SMTP like Martin's example. -bs
is for running an SMTP server as a deamon. Sendmail will send directly to the receiving mail server (on port 25) unless you override it in the configuration file. You can specify the configuration file by the -C
paramter.
In the configuration, you can specify a relay server (any mail server or sendmail running -bs
on another machine)
Using a properly configured relay server is good idea because when IT manages mail servers they implement SPF and domain keys. That keeps your mail out of the junk bin.
If port 25 is blocked you are left with two options.
sendmail -bd
on a machine outside of
the corporate firewall that listens
on a port other than 25.I believe you can add configuration parameters on the command line. What you want is the SMART_HOST option. So call Sendmail like sendmail -OSMART_HOST=nameofhost.com
.