我的代码:
print ' '
sender = raw_input('Attacker Email: ')
print ' '
subjcet = raw_input('Subject: ')
print ' '
password = raw_input('Password: ')
print ' '
recipients = raw_input ('Emails, Multiple with "," : ')
print ' '
msg = raw_input('Message: ')
print ' ' +bcolors.OKBLUE
s = smtplib.SMTP(host='smtp.gmail.com', port=587)
s.ehlo()
s.starttls()
s.ehlo()
s.login(sender, password)
s.sendmail(sender, recipients, msg)
print "Email sent to: " + recipients
我希望它向recipients = raw_input
中的所有电子邮件发送一封邮件
但是它只是将邮件发送到第一封电子邮件。 任何帮助都很好
谢谢。
答案 0 :(得分:0)
收件人当前是一个字符串:"E1, E2, E3"
您需要将其作为列表:["E1", "E2", "E3"]
尝试一下:
recipients = recipients.split(", ")