** * This is an example of how the program can be easily abused, not an article that promotes cybercrime. Thank you. ** **
itazura.py
1import smtplib
2 from email.mime.text import MIMEText
3
4 for i in range(100):
5 #Function to send mail from Yahoo Mail
6 def send_mail(co_msg):
7 SMTP_SERVER = "smtp.mail.yahoo.co.jp"
8 SMTP_PORT = 587
9 SMTP_USERNAME = "[email protected]"#Your user name or registered address
10 SMTP_PASSWORD = "test"#My password
11 EMAIL_FROM ="[email protected]"#I also send the email address
12 EMAIL_TO = "[email protected]"#Destination email address
13 EMAIL_SUBJECT = "pythontest"#Title
14 msg = MIMEText(co_msg)
15 msg['Subject'] = EMAIL_SUBJECT
16 msg['From'] = EMAIL_FROM
17 msg['To'] = EMAIL_TO
18 mail=smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
19 mail.login(SMTP_USERNAME, SMTP_PASSWORD)
20 mail.sendmail(EMAIL_FROM, EMAIL_TO, msg.as_string())
21 mail.quit()
22 return
23
24
25 #Function execution
26 text='I win! Please think about why you lost by tomorrow.'
28 send_mail(co_msg=text)
~
that's all. Please adjust because there is a number of times on the 4th line. Next is the setting of Yahoo Mail.
Please do it like this. When you run the program, you will receive 100 emails to that destination. to come. **To go. Please do not abuse it. ** **
Recommended Posts