Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ########################################################
- ''' SMTP_Email by i-s-e-K --> twitter.com/_isek_ <-- '''
- ########################################################
- # Imports standard modules
- from os import system
- from email.mime.text import MIMEText
- import smtplib
- # Clears the command line
- cls = lambda: system('cls')
- def email(SERVER, USER, PASS, TO, SUBJECT, MESSAGE):
- # Remaining parts of an email
- PORT = 587
- FROM = USER
- # Creates an email
- message = MIMEText(MESSAGE)
- message['From'] = FROM
- message['To'] = ','.join(TO)
- message['Subject'] = SUBJECT
- # Sends an email
- email = smtplib.SMTP()
- email.connect(SERVER,PORT)
- email.starttls()
- email.login(USER,PASS)
- email.sendmail(FROM, TO, message.as_string())
- email.quit()
- cls()
- # Asks for parts of an email
- SERVER = raw_input('Enter the server: ')
- USER = raw_input('Enter the username with @domain.tld: ')
- PASS = raw_input('Enter the password: ')
- TO = [raw_input('Enter the recipient [for more than one use comma]: ')]
- SUBJECT = raw_input('Enter the subject: ')
- MESSAGE = raw_input('Enter the message: ')
- email(SERVER, USER, PASS, TO, SUBJECT, MESSAGE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement