{"id":113,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=113"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"send-mail-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=113","title":{"rendered":"Send mail from the command line"},"content":{"rendered":"<p>BeOS does not include a full-blown command-line mail client (though you can download pine if you need it), but it does let you send off quick messages and text attachments if necessary. Try this:<br \/>\n<code><br \/>\nmail -s \"Howdy!\" someone@somewhere.com<br \/>\n[Enter message body here]<br \/>\n<\/code><br \/>\nWhen done with your message, tap Ctrl-D. This sends an EOF (end of file) mark, which sends the message, using the settings established in the E-mail preferences panel. If you want to send an existing text file as the message body, use:<br \/>\n<code><br \/>\nmail -s \"Howdy!\" someone@somewhere.com &amp;lt; \/path\/to\/file.txt<br \/>\n<\/code><br \/>\nNote however that if you do this with a binary, rather than a text file, the binary will end up in the message body, not as an attachment.<\/p>\n<hr \/>\n<p>Roman Filippov (rxf at alkor dot ru) adds:<br \/>\nThe mail utility can also take two flags for setting CC: and BCC: addresses:<\/p>\n<pre>\n -c someone@somewhere.com\n<\/pre>\n<p>and<\/p>\n<pre>\n-b someone@somewhere.com\n<\/pre>\n<p>You can also list as many recepients as you wish on the command line. (e.g.: <code>mail -s \"Hello!\" first@somewhere.com second@somewhere.com third@somewhere.com<\/code>) This is equivalent to entering multiple recepients in the To: field of a GUI mail client.<br \/>\nIt&#8217;s also possible to send a binary file using mail, but it takes a bit more work, as you&#8217;ll need to convert the binary to text format with uuencode:<\/p>\n<pre>\nmail -s \"Hello!\" someone@somewhere.com &amp;lt; uuencode  \/path\/to\/file.zip\n remote_file\n<\/pre>\n<p>where <code>remote_file<\/code> stands for the file name which will be created by the decoder on the recipient computer, and <code>\/path\/to\/file.zip<\/code> is the path to the binary file you wish to send.<br \/>\nTo decode the file on the recepient side type: <\/p>\n<pre> uudecode &amp;lt; received_e-mail_file_name <\/pre>\n<p> These commands, paired with attribute manipulation utilities and grep, can be used to build powerful script-based mail processing systems similar to those found in commercial mail clients.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BeOS does not include a full-blown command-line mail client (though you can download pine if you need it), but it does let you send off quick messages and text attachments if necessary. Try this: mail -s &#8222;Howdy!&#8220; someone@somewhere.com [Enter message body here] When done with your message, tap Ctrl-D. This sends an EOF (end of [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[11],"class_list":["post-113","post","type-post","status-publish","format-standard","hentry","tag-terminal"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=113"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/113\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}