Thursday, July 30, 2009

Sending a gmail from the command line (ubuntu)

I found out about this on the net and thought you might find it useful. I use it to have one of my boxes email my phone whenever it needs to.
apt-get install sendemail

Now to send a message using your gmail account ( this is entered on one line)

sendEmail -f my.account@gmail.com -t myself@domain.tld -u this is the test tile -m “this is a test message” -s smtp.gmail.com -o tls=yes -xu usernameonly -xp mypasswd


*note that the above is all on one line and that the -xu username only is just the username, not the username@gmail.com

The stuff for this post was taken from http://www.debianadmin.com/how-to-sendemail-from-the-command-line-using-a-gmail-account-and-others.html and they have many more examples, I just made it more newbie friendly

No comments: