Created
March 8, 2018 08:42
-
-
Save robbert1978/f573e075a374dd7cfaa4134f2ac590ab to your computer and use it in GitHub Desktop.
Spam or send an email
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
print" _____|#|_____ " | |
print" |_____________| " | |
print" |_______________| " | |
print" ||_EMAIL_###_BOX_|| " | |
print" | |-|-|-|||-|-|-| | " | |
print" | |-|-|-|||-|-|-| | " | |
print" | |_|_|_|||_|_|_| | " | |
print" | ||~~~| | |---|| | " | |
print" | ||~~~|!|!| O || | " | |
print" | ||~~~| |.|___|| | " | |
print" | ||---| | |---|| | " | |
print" | || | | | || | " | |
print" | ||___| | |___|| | " | |
print" | ||---| | |---|| | " | |
print" | || | | | || | " | |
print" | ||___| | |___|| | " | |
print" |-----------------| " | |
print" | Gmail.com | " | |
print" -------------------" | |
import smtplib | |
username = raw_input('Username:') | |
password = raw_input('Password:') | |
try: | |
server = smtplib.SMTP('smtp.gmail.com:587') | |
server.starttls() | |
server.login(username, password) | |
except: | |
print '[*]The username or password is incorret.' | |
else: | |
print '[*]Logged in successfully.' | |
print 'Send an email or spam:' | |
print '1.Send an email.' | |
print '2.Spam' | |
a=raw_input('Email-box:') | |
x=int(a) | |
if x == 1: | |
fromaddr = raw_input('From:') | |
toaddr = raw_input('To:') | |
msg = raw_input('Msg:') | |
try: | |
server.sendmail(fromaddr, toaddr, msg) | |
except: | |
print '[*]Error, can not send email.' | |
else: | |
print '[*]Gmail.com has finished sending the emails.' | |
elif x == 2: | |
fromaddr = raw_input('From:') | |
toaddr = raw_input('To:') | |
msg = 'This is a spam.' | |
print 'Msg:', msg | |
print 'Sending, press Ctrl+C to stop.' | |
y=raw_input('Press a number > 0:') | |
b=int(y) | |
while b > 0: | |
try: | |
server.sendmail(fromaddr, toaddr, msg) | |
except: | |
print '[*]Error, can not send email.' | |
else: | |
print '[*]Gmail.com has finished sending the emails.' | |
else: | |
print 'Goodbye.' | |
print 'Thank you.' | |
server.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment