adapter pattern nextyou implement an email sender as classsince by now you suspect that if you are going to build larger systems you will need to work in an object-oriented way the emailsender class handles the details of sending message to user users are stored in comma-separated values (csvfilewhich you load as needed users csv namesurnameemail peterpotterpeter@example comma here is what your email-sending class might look like on first passmail_sender py import csv import smtplib from email mime text import mimetext class mailer(object)def send(senderrecipientssubjectmessage)msg mimetext(messagemsg['subject'subject msg['from'sender msg['to'[recipientss smtplib smtp('localhost' send_message(recipients quit(if __name__ ="__main__"with open('users csv'' 'as csv_filereader csv dictreader(csv_fileusers [ for row in readermailer mailer(mailer send'me@example com'[ ["email"for in users]"this is your message""have good day