Your task is to write an email client.
It should be able to connect to an email server, and deliver email to
that server. You must use the SMTP protocol.
Points |
Task |
10 |
Makes a socket to the email server |
10 |
Gets the username and email server name from the user |
10 |
Gets the body of the message from the user |
10 |
Can figure out the MX server programatically (Extra Credit. Very hard. Most people don’t get this!) |
60 |
User actually gets email |
-5 |
Every error check missing from read or write or the response |
-10 |
Not sending headers by Fri Feb 20th |
-10 |
Not done by Wed Feb 25th |
Here's a sample dialog between a user
and the program
Send to whom?> rappleto@nmu.edu Message Sent |
220
mx.google.com ESMTP d75a77b69052e-506a604eb55si92703121cf.353 –
gsmtp Test 2 . |
Checklist:
connect to the server port 25
Read from the server. If they don't reply, you're blocked!
send "HELO sourcehostname\r\n"
check for a good reply
send "MAIL FROM: who_you_are\r\n"
check for a good reply
send "RCPT TO: who_gets_this\r\n"
Check for a good reply
Send "DATA\r\n"
Check for a good reply
Send
Message-ID:<CAEb5kgpPWSWWqL0Kj=Nui2NbTcF+_tB6CKXfAQzdZBpK6wzp=w@mail.gmail.com>
Subject:
Vote for me
From:<rappleto@nmu.edu>
To:<rappleto@nmu.edu>
Send "\r\n\r\n"
Send the text of the message and then "\r\n"
Send ".\r\n"
Check for a good reply
Send "QUIT\r\n"
Check for a good reply
exit the program.
Go check you email. It PROBABLY in your spam folder