Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- import smtplib
- import getpass
- import sys
- def banner(text, ch='=', length=78):
- """
- _____ _ __ ___
- / ___/____ ____ _____ ___ ____ _(_) / _ __ < /
- \__ \/ __ \/ __ `/ __ `__ \/ __ `/ / / | | / / / /
- ___/ / /_/ / /_/ / / / / / / /_/ / / / | |/ / / /
- /____/ .___/\__,_/_/ /_/ /_/\__,_/_/_/ |___(_)_/
- __ /_/ _____ __ __
- / /_ __ ___ / ___/___ ____ ___ ____ ____ _/ /_/ /____
- / __ \/ / / (_) \__ \/ _ \/ __ `__ \/ __ \/ __ `/ __/ __/ _ \
- / /_/ / /_/ / ___/ / __/ / / / / / /_/ / /_/ / /_/ /_/ __/
- /_.___/\__, (_) /____/\___/_/ /_/ /_/ .___/\__,_/\__/\__/\___/
- /____/ /_/
- """
- server = input("Mail server: Gmail, HotmailOutlook o Yahoo: ")
- server = server.lower()
- user = input('Tu correo: ')
- password = getpass.getpass('Tu contraseña: ')
- to = input('\nPara: ')
- body = input('Mensaje a mostrar: ')
- numero = int(input('Numero de veces a enviar: '))
- if server == 'gmail':
- smtp_server = 'smtp.gmail.com'
- port = 587
- elif server == 'yahoo':
- smtp_server = 'smtp.mail.yahoo.com'
- port = 465
- elif server == 'hotmail':
- smtp_server = 'smtp.live.com'
- port = 25
- else:
- print('Mail server erroneo, intentalo de nuevo.')
- sys.exit()
- try:
- server = smtplib.SMTP(smtp_server,port)
- server.ehlo()
- if smtp_server == 'smtp.gmail.com':
- server.starttls()
- server.login(user,password)
- for i in range(1, numero+1):
- subject = os.urandom(9)
- msg = (body)
- server.sendmail(user,to,msg)
- sends = "\rE-mails enviados: %i" % i
- print(sends)
- sys.stdout.flush()
- server.quit()
- print("Hecho con exito!")
- except KeyboardInterrupt:
- print("[Ctrl+C]Cancelado por el usuario")
- sys.exit()
- except smtplib.SMTPAuthenticationError:
- print('\n[!] El usuario o contraseña introducidos son erroneos.')
- sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement