Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- msg = MIMEMultipart('related')
- msg['Subject'] = "Welcome to my website"
- msg['from'] = "activity@mydomain.com"
- part = MIMEText("Body of the email",'plain')
- msg.attach(part)
- fromaddr = "activity@mydomain.com"
- toaddrs = "someone@gmail.com"
- username = "activity@mydomain.com"
- password = "password"
- # The actual mail send
- try:
- server = smtplib.SMTP('mydomain.com',587)
- server.starttls()
- server.login(username,password)
- #server.ehlo()
- server.sendmail(fromaddr, toaddrs, msg.as_string() )
- server.quit()
- except:
- print "Error: unable to send email"
- Oct 19 22:11:52 box postfix/smtp[28666]: Untrusted TLS connection established to alt1.gmail-smtp-in.l.google.com[74.125.198.26]:25: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
- Oct 19 22:11:52 box postfix/smtp[28666]: B3F0F10583D: to=<someone@gmail.com>, relay=alt1.gmail-smtp-in.l.google.com[74.125.198.26]:25, delay=602, delays=598/0.01/4/0.5, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.198.26] said: 421-4.7.0 [202.89.139.221 15] Our system has detected that this message is 421-4.7.0 suspicious due to the very low reputation of the sending IP address. 421-4.7.0 To protect our users from spam, mail sent from your IP address has 421-4.7.0 been temporarily rate limited. Please visit 421 4.7.0 https://support.google.com/mail/answer/188131 for more information. t16si4047297oih.239 - gsmtp (in reply to end of DATA command))
Add Comment
Please, Sign In to add comment