Send email from command line

From UFP-UV Sakai Wiki

Jump to: navigation, search

Contents


Need to replace email addresses below!

Simple email

telnet SERVER_HOSTNAME SERVER_PORT
 
HELO server
MAIL FROM: <nuno@ufp.edu.pt>
RCPT TO: <test1@10.11.4.14>
DATA
Subject: Test Email
 
Hello world!
This is a test email!
.


Email with attachment

telnet SERVER_HOSTNAME SERVER_PORT
 
MAIL FROM: <nuno@ufp.edu.pt>
RCPT TO: <sitestats-test@sakaitest.ufp.pt>
DATA
From: nuno@ufp.pt
To: sitestats-test@sakaitest.ufp.pt
Subject: Nice beginning of a mail message
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="arbitraryBoundaryString"
 
--arbitraryBoundaryString
Content-Type: text/plain; charset="us-ascii"
 
This text is a part of an arbitrary
message used as an example of a plain text message.
 
--arbitraryBoundaryString
Content-Type: application/octet-stream; name="Test_document.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Test_document.doc"
 
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAA
EAAABQEAAAEAAAD+////AAAAAAQAAAAGAAAADgEAAP//////////////////////////////////
////////////////////////////////////////////////////////////////////////////
 
...............
 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA=
--arbitraryBoundaryString
 
.
Personal tools