Question

I want to make use of SMTP. I have written a simple code that will send mail from one mail address to another.

import smtplib
msg = "smtp_mail" 
server = smtplib.SMTP('MailServerAddress') 
server = smtplib.SMTP(server)
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddrs, msg) 
server.quit() 

here I am getting an error AttributeError: SMTP instance has no attribute 'find'

Please help!!

Was it helpful?

Solution

Your program crashes on line : server = smtplib.SMTP(server)

Just remove this line, it's twice !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top