Wednesday, March 27, 2013

Setup Email Server in Ubuntu


  • Install ssmtp Install ssmtpsudo apt-get install ssmtp
    Install mail Util sudo apt-get install mailutils
  • Edit the ssmtp config file : gksu gedit /etc/ssmtp/ssmtp.conf
  • Enter this in the file:
    root=username@gmail.com
    mailhub=smtp.gmail.com:465
    rewriteDomain=gmail.com
    AuthUser=username
    AuthPass=password
    FromLineOverride=YES
    UseTLS=YES
  • Enter the email address of the person who will receive your email:
    ssmtp recepient_name@gmail.com
  • Now enter this:
    To: recipient_name@gmail.com
    From: username@gmail.com
    Subject: Sent from a terminal!

    Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
  • To send the emailCtrl + D

You can also save the text mentioned in Point 5 into a text file and send it using:
ssmtp recipient_name@gmail.com < filename.txt
"mater" | mail -s 'Process snapshot' psramkumar@gmail.com

No comments: