The purpose of this script is to send an email to a receivers list, and the code works just for the first receiver but the never works for the rest of the list.
here is the code:
class email:
def __init__(self, sender, subject, message):
self.sender = sender
self.subject = subject
self.message = message
def receivers(self):
receivers = ('adam', 'tom', 'mel')
for receiver in receivers:
return receiver
def send(self):
print('we send email from'.capitalize(), self.sender, 'to', email.receivers().title(), 'and the subject is',
self.subject, 'finally the massage is', self.message)
email = email('sayed', 'morning message', 'wake up man')
email.send()
here is the result:
We send email from sayed to Adam and the subject is morning message finally the massage is wake up man