Manoj Pandey
Manoj Pandey

Reputation: 257

Attribute error in smtp

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

Upvotes: 0

Views: 5359

Answers (1)

Raf
Raf

Reputation: 146

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

Just remove this line, it's twice !

Upvotes: 3

Related Questions