Last active
May 16, 2017 08:50
-
-
Save DustinAlandzes/c38eaf0f186a2681401b05d422aebad2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # smtp library that does it all for you! | |
| import smtplib as s | |
| # organic whole range smtp server goes here | |
| smtpServer = "" | |
| # usually 25, 465, 587 | |
| smtpPort = | |
| username = "" | |
| password = "" | |
| numOfMessages = 20 | |
| message = "hello world" | |
| WhoToSendTo = "[email protected]" | |
| # okay, so connect to the smtp server, specify ip and port | |
| obj = s.SMTP(smtpServer, smtpPort) | |
| # wtf is ehlo | |
| obj.ehlo() | |
| # start tls sure | |
| obj.starttls() | |
| # wtf is ehlo | |
| obj.ehlo() | |
| # ok, login specify username and password | |
| obj.login(username, password) | |
| # i guess this is the structure of the actual message | |
| message = ("From: "+username+"\r\nTo: "+fullAddress+" \r\n\r\n "+message) | |
| # same as `for (x = 0; x < numOfMessages; x++)` | |
| for x in range(numOfMessages): | |
| # cool, we're actually sending the mail | |
| obj.sendmail(username, WhoToSendTo, message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment