Domanda

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!!

È stato utile?

Soluzione

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

Just remove this line, it's twice !

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top