Socket Programming Assignment - Python3 SMTP mail client By the end of this assignment, you will have acquired a better understanding of SMTP protocol. You will also gain experience in implementing a standard protocol using Python3. Your task is to develop a simple mail client that sends email to any recipient. Your client will need to (1) connect to a mail server, (2) dialogue with the mail server using the SMTP protocol, (3) and send an email message to the mail server. Python provides a module, called smtplib, which has built in methods to send mail using SMTP protocol. However, we will not be using this module in this lab, because it hide the details of SMTP and socket programming. In order to limit spam, some mail servers do not accept TCP connection from arbitrary sources. For the experiment described below, you may want to try connecting both to your university mail server and to a popular Webmail server, such as a google mail server. To obtain the name of a google mail server try: nslookup -type=MX google.com This query returns several mail server names such as aspmx.l.google.com You may also try making your connection both from your home and from your university campus. Below you will find the skeleton code for the client. You are to complete the skeleton code. The places where you need to fill in code are marked with -->??? Each place may require one or more lines of code. Additional Notes: In some cases, the receiving mail server might classify your e-mail as junk. Make sure you check the junk/spam folder when you look for the e-mail sent from your client. Even better, use a free fake SMTP server available online to test your client. Skeleton Python Code for the Mail Client from socket import * # Message to be sent msg = '\r\nI love computer networks! This is the body of the e-mail.' endmsg = '\r\n.\r\n' # Choose a mail server (e.g. Google mail server) and call it mailserver # mailserver = 'smtp.gmail.com' mailserver = "-->???" # Create socket called clientSocket and establish a TCP connection with mailserver -->??? # Port number may change according to the mail server clientSocket.connect((mailserver, 12000)) recv = clientSocket.recv(1024).decode('utf-8') print("Coonnection data rcvd from server: " + recv) if recv[:3] != '220': print('220 reply not received from server.') # Send HELO command and print server response. heloCommand = 'HELO gmail.com\r\n' clientSocket.send(heloCommand.encode('utf-8')) recv1 = clientSocket.recv(1024).decode('utf-8') print("At HELO: " + recv1) if recv1[:3] != '250': print('250 reply not received from server.') # Send MAIL FROM command and print server response. mailfrom = 'MAIL FROM: \r\n' clientSocket.send(mailfrom.encode('utf-8')) recv2 = -->??? print(recv2) if recv2[:3] != '250': print('250 reply not received from server.') # Send RCPT TO command and print server response. rcptto = 'RCPT TO: \r\n' -->??? # Send DATA command and print server response. data = 'DATA\r\n' -->??? print(recv4) if recv4[:3] != '354': print('354 reply not received from server.') # Send message data. # Must be Subject, NOT SUBJECT, otherwise it will not display in the subject line clientSocket.send('Subject: Greeting to you!\r\n'.encode('utf-8')) -->??? #send the msg (body of e-mail) # Message ends with a single period on a line. -->??? #send the endmsg # Send QUIT command and get server response. quitcommand = 'QUIT\r\n' -->??? print(recv6) if recv6[:3] != '221': print('221 reply not received from server.')