Shruti Srivastava Shruti Srivastava -3 years ago 129
Python Question

Attachments getting attached twice using smptplib in python

I am trying to implement a functionality in python where I want to send a
file as an attachment to an email alert
Everything works fine. i am getting the email alert with required subject but the only problem is that I get the same attachment twice in my email alert.

fileMsg = email.mime.base.MIMEBase('application','octet-stream')

# send email
server = smtplib.SMTP(smtp_server)
server.login(username, password)
server.sendmail(from_add, to_addr,emailMsg.as_string())

Answer Source

There was an issue with the version..Has been resolved

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download