Friday, March 18, 2011

Gmail Ubuntu Desktop Simple Mail

Send a simple mail from Ubuntu Desktop using ssmtp

1. Install ssmpt from System- >Administration->Synaptic
2. Go to /etc/ssmtp and edit ssmtp.conf

Debug=YES
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=yourgmailusername@gmail.com

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=yourgmailusername@gmail.com

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
UseSTARTTLS=YES
FromLineOverride=YES

AuthUser=yourgmailusername@gmail.com
AuthPass=yourgmailpassword
AuthMethod=Login
AuthMethod=PLAIN


Now from terminal

localadmin@localadmin:~$ ssmtp destinationemailaddress@yahoo.com
To : destinationemailaddress@yahoo.com
From : youremailaddress@gmail.com
Subject : hi

Hi
Now press Cntrl D. If any difficulty instead of yahoo try any other gmail address.

If you get this - it means your username or password is in correct
Authorization failed (535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 27sm2207505yhl.25)