Hello NG,
How can I send an email with an attachment from a python script?
My code so far:
mailhost = container.mailH ost
mMsg = 'MessageText'
mTo = 'you@you.com'
mFrom = 'me@me.com'
mSubj = 'Subject'
This code sends me an email with 'Subject' and 'MessageText' .
After googling and reading in different tutorials, I found a way to
implement it in dtml:
<dtml-sendmail smtphost="MailH ost">
To: you@you.com
From: Me me@me.com
Subject: <dtml-var "var1">
<dtml-mime type="text/plain" encode="7bit">
Hi, please take a look at my resume.
<dtml-boundary type="applicati on/octet-stream" disposition="at tachment"
encode="base64" filename_expr=" resume_file.get Id()"><dtml-var
expr="resume_fi le">
</dtml-mime>
</dtml-sendmail>But how to do so in python only?Thanks alotChristian
How can I send an email with an attachment from a python script?
My code so far:
mailhost = container.mailH ost
mMsg = 'MessageText'
mTo = 'you@you.com'
mFrom = 'me@me.com'
mSubj = 'Subject'
This code sends me an email with 'Subject' and 'MessageText' .
After googling and reading in different tutorials, I found a way to
implement it in dtml:
<dtml-sendmail smtphost="MailH ost">
To: you@you.com
From: Me me@me.com
Subject: <dtml-var "var1">
<dtml-mime type="text/plain" encode="7bit">
Hi, please take a look at my resume.
<dtml-boundary type="applicati on/octet-stream" disposition="at tachment"
encode="base64" filename_expr=" resume_file.get Id()"><dtml-var
expr="resume_fi le">
</dtml-mime>
</dtml-sendmail>But how to do so in python only?Thanks alotChristian
Comment