Link to home
Start Free TrialLog in
Avatar of midstar
midstar

asked on

Sending parameters to pythons smtplib

I'm using the smtplib library to send emails, but I'd like to use sendmail's -L parameter so that I can assign my own tracking ID in the logs. I can't figure out how to send parameters such as this one with the smtplib library.

The smtp.sendmail() function has 4th and 5th parameters which are optional, but I'm not sure I can use them here.  In my code I have:

     smtp.sendmail(send_from, send_to, msg.as_string(),"-L12345")

but it gives me an error, "5.5.4 - parameter unrecognized".

If somebody has a solution which doesn't use the smtplib library, that's fine, but I need the ability to send attachments, and I couldn't figure out another easy way of doing this.

THANKS!

ASKER CERTIFIED SOLUTION
Avatar of jar3817
jar3817

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial