You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, sending mail to a local serving using the following command fails because SMTP AUTH extension not supported by server:
importsmtplibfromemail.mime.multipartimportMIMEMultipartfromemail.mime.textimportMIMEText# SMTP server detailssmtp_server="localhost"smtp_port=8025# Sender and recipient detailssender="[email protected]"recipient="[email protected]"# Create a message objectmessage=MIMEMultipart()
message["From"] =sendermessage["To"] =recipientmessage["Subject"] ="Test email"# Add message contentmessage.attach(MIMEText("This is a test email.", "plain"))
# Connect to the SMTP server with TLSsmtp_obj=smtplib.SMTP(smtp_server, smtp_port)
smtp_obj.starttls() # Enable TLS# Send the emailsmtp_obj.login(sender, "some_password") # <--- THIS LINE BREAKS THE SERVERsmtp_obj.sendmail(sender, recipient, message.as_string())
# Disconnect from the serversmtp_obj.quit()
print("Email sent successfully!")
The text was updated successfully, but these errors were encountered:
Is it possible to parse AUTH commands as well?
For example, sending mail to a local serving using the following command fails because SMTP AUTH extension not supported by server:
The text was updated successfully, but these errors were encountered: