Here's a simple 3 step process for configuring you mac to send email from the command line using a gmail account. You will need to:
If you haven't already installed macports go here: macports and get it, and install it.
Step 2, Install ssmtp from macports
Open a terminal window and use the following to install the ssmtp software
$ sudo port install ssmtp
Step 3, Update the ssmtp configuration files
Using your fav editor, make the following changes to the non-existent ssmtp.conf file:
$ sudo vi /opt/local/etc/ssmtp/ssmtp.conf
root=yourgmailaccount@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=yourgmailaccount@gmail.com
UseSTARTTLS=YES
AuthUser=gmail_username_here
AuthPass=gmail_password_here
FromLineOverride=YES
Now edit the rev aliases file
$ sudo vi /opt/local/etc/ssmtp/revaliases
root:yourgmailaccount@gmail.com:smtp.gmail.com:587
rob:yourgmailaccount@gmail.com:smtp.gmail.com:587
Step 4, Test
Test that it works, from the command line:
$ /opt/local/sbin/ssmtp rob@somewhere.com
Subject: some subject
this is some text
^d
(Use ctrl d to after you've finished writing your message.)
- Install macports if you haven't already
- Install ssmtp from macports
- Update the ssmtp configuration files
If you haven't already installed macports go here: macports and get it, and install it.
Step 2, Install ssmtp from macports
Open a terminal window and use the following to install the ssmtp software
$ sudo port install ssmtp
Step 3, Update the ssmtp configuration files
Using your fav editor, make the following changes to the non-existent ssmtp.conf file:
$ sudo vi /opt/local/etc/ssmtp/ssmtp.conf
root=yourgmailaccount@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=yourgmailaccount@gmail.com
UseSTARTTLS=YES
AuthUser=gmail_username_here
AuthPass=gmail_password_here
FromLineOverride=YES
Now edit the rev aliases file
$ sudo vi /opt/local/etc/ssmtp/revaliases
root:yourgmailaccount@gmail.com:smtp.gmail.com:587
rob:yourgmailaccount@gmail.com:smtp.gmail.com:587
Step 4, Test
Test that it works, from the command line:
$ /opt/local/sbin/ssmtp rob@somewhere.com
Subject: some subject
this is some text
^d
(Use ctrl d to after you've finished writing your message.)
Is it possible to select a create a subject heading?
ReplyDeleteMany thanks
Yup I've updated the post to show sending a subject.
ReplyDeleteIt works well! Thank you
ReplyDeleteI got an erro msg like this:
ReplyDeletessmtp: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. c6sm550915pbu.51 - gsmtp)
any idea what may have gone wrong?
I got an erro msg like this:
ReplyDeletessmtp: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. c6sm550915pbu.51 - gsmtp)
any idea what may have gone wrong?
I figured it out: it was a typo.
ReplyDeleteI figured it out: it was a typo.
ReplyDelete