Already registered? Log in
Please make sure that you have imported necessary modules being used in this Python script.
Please change the following in this script:
#!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
username = 'USERNAME'
password = 'PASSWORD'
msg = MIMEMultipart('mixed')
sender = 'sender@example.com'
recipient = 'recipient@example.com'
msg['Subject'] = 'Your Subject'
msg['From'] = sender
msg['To'] = recipient
text_message = MIMEText('It is a text message.', 'plain')
html_message = MIMEText('It is a html message.', 'html')
msg.attach(text_message)
msg.attach(html_message)
mailServer = smtplib.SMTP('mail.smtp2go.com', 2525) # 8025, 587 and 25 can also be used.
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(username, password)
mailServer.sendmail(sender, recipient, msg.as_string())
mailServer.close()
Try SMTP2GO free for as long as you like:
Try SMTP2GO Free → Paid plans available for over 1,000 emails/month.