{"id":365,"date":"2012-12-15T19:56:42","date_gmt":"2012-12-15T19:56:42","guid":{"rendered":"http:\/\/62.131.51.129\/wordpress\/?p=365"},"modified":"2012-12-15T19:56:42","modified_gmt":"2012-12-15T19:56:42","slug":"send-an-attachment-via-email","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=365","title":{"rendered":"Send an attachment via email"},"content":{"rendered":"<p>It is possible to use telnet to send an email. This is even quite straightforward.<br \/>\nThe idea is to start a telnet session with: telnet mail.wxs.nl 25 (or something alike that contains an email server to which one has connection.<\/p>\n<p>One could then enter to indicate the sender and receiver of an email:<\/p>\n<pre>\nhelo mail.wxs.nl\nmail from: tom.vanmaanen@wxs.nl\nrcpt to: tom.vanmaanen@wxs.nl\n\n<\/pre>\n<p>The actual content of the email is then provided by:<\/p>\n<pre>\ndata\nSubject: Onzin van Tom\nMIME-Version: 1.0 \nContent-Type: multipart\/mixed; \n boundary= \"KkK170891tpbkKk__FV_KKKkkkjjwq\" \n\n--KkK170891tpbkKk__FV_KKKkkkjjwq \nContent-Type: text\/plain; charset=US-ASCII \n\nDit is mijn boodschap\n\n<\/pre>\n<p>One finishes with an empty line and a dot:<\/p>\n<pre>\n\n.\n<\/pre>\n<p>All commands and the actual text is sent in plain text. It is human readable.<br \/>\nThis makes it understandable that an attachment which is in binary format must be translated into plain text before it can be sent. Let us take as example an Access file (a.mdb), that must be translated into plain text. This will look like:<\/p>\n<pre>\n--KkK170891tpbkKk__FV_KKKkkkjjwq \nMIME-Version: 1.0\nContent-Description: \"Base64 encode of a.mdb by Wincode 2.7.3\"\nContent-Type: application\/msaccess; name=\"a.mdb\"\nContent-Transfer-Encoding: Base64\nContent-Disposition: attachment; filename=\"a.mdb\"\n\nAAEAAFN0YW5kYXJkIEpldCBEQgABAAAAtW4DYmAJwlXpqWdyQD8AnH6fkP+FmjHFebrtMLzfzJ1j2eTDn0b7irxOmGXsN0PanPrYwCjmDSiKYEoKezbr7N+xaWoTQ9ExsTMq\/3lbjCt8KqPgfJkIH5j9DJFyW7X9g2ZflfjQiSSFZ8YfJ0TS7s9l7f8Hx0aheBYM7ektYtRUBgAANC4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\n...\n\n--KkK170891tpbkKk__FV_KKKkkkjjwq-- \n\n<\/pre>\n<p>A full example can be found here: <a href='http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/12\/a.txt'>ExampleEmail<\/a>.<\/p>\n<p>One may question how the encoding can be accomplished. To do so, I found a set of useful websites (like http:\/\/www.opinionatedgeek.com\/dotnet\/tools\/base64encode\/ ) in which you may upload the binary file and one may get it encoded back. This can then be included in the mail session.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is possible to use telnet to send an email. This is even quite straightforward. The idea is to start a telnet session with: telnet mail.wxs.nl 25 (or something alike that contains an email server to which one has connection. One could then enter to indicate the sender and receiver of an email: helo mail.wxs.nl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-365","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/365\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}