{"id":1613,"date":"2014-06-13T15:14:33","date_gmt":"2014-06-13T15:14:33","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=1613"},"modified":"2014-09-26T15:05:12","modified_gmt":"2014-09-26T15:05:12","slug":"ssmtp-to-send-emails","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/software_utilities\/email\/ssmtp-to-send-emails","title":{"rendered":"ssmtp to send emails"},"content":{"rendered":"<p>\nssmtp is a nice and simple solution for sending emails from the command line etc.\n<\/p>\n<h4>\nInstalling<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nsudo apt-get install ssmtp\r\nsudo apt-get install mailutils\r\n<\/code><\/pre>\n<p>\nNow edit the SSMTP configuration file\n<\/p>\n<pre>\r\n<code>\r\nsudo nano \/etc\/ssmtp\/ssmtp.conf\r\n<\/code><\/pre>\n<p>\nIt needs to include this:\n<\/p>\n<pre>\r\n<code>\r\nroot=postmaster\r\nmailhub=smtp.gmail.com:587\r\nhostname=raspberrypi\r\nAuthUser=AGmailUserName@gmail.com\r\nAuthPass=TheGmailPassword\r\nFromLineOverride=YES\r\nUseSTARTTLS=YES\r\n<\/code><\/pre>\n<p>\nSave and exit\n<\/p>\n<h4>\nSending an email<br \/>\n<\/h4>\n<pre>\r\n<code>\r\necho &quot;Hello world email body&quot; | mail -s &quot;Test Subject&quot; recipientname@domain.com\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<h4>\nSending A File<br \/>\n<\/h4>\n<p>\nInstall mpack\n<\/p>\n<pre>\r\n<code>\r\nsudo apt-get install mpack\r\n<\/code><\/pre>\n<p>\nTo send a file\n<\/p>\n<pre>\r\n<code>\r\nmpack -s &quot;Test&quot; \/home\/pi\/some_folder\/somefile.ext recipientname@domain.com\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ssmtp is a nice and simple solution for sending emails from the command line etc. Installing sudo apt-get install ssmtp sudo apt-get install mailutils Now edit the SSMTP configuration file sudo nano \/etc\/ssmtp\/ssmtp.conf It needs to include this: root=postmaster mailhub=smtp.gmail.com:587 hostname=raspberrypi AuthUser=AGmailUserName@gmail.com AuthPass=TheGmailPassword FromLineOverride=YES UseSTARTTLS=YES Save and exit Sending an email echo &quot;Hello world email [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1613","post","type-post","status-publish","format-standard","hentry","category-email"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=1613"}],"version-history":[{"count":3,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1613\/revisions"}],"predecessor-version":[{"id":1616,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/1613\/revisions\/1616"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=1613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=1613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=1613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}