C
Christian Otteneuer
Hello NG,
How can I send an email with an attachment from a python script?
My code so far:
mailhost = container.mailHost
mMsg = 'MessageText'
mTo = '(e-mail address removed)'
mFrom = '(e-mail address removed)'
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="MailHost">
To: (e-mail address removed)
From: Me (e-mail address removed)
Subject: <dtml-var "var1">
<dtml-mime type="text/plain" encode="7bit">
Hi, please take a look at my resume.
<dtml-boundary type="application/octet-stream" disposition="attachment"
encode="base64" filename_expr="resume_file.getId()"><dtml-var
expr="resume_file">
</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.mailHost
mMsg = 'MessageText'
mTo = '(e-mail address removed)'
mFrom = '(e-mail address removed)'
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="MailHost">
To: (e-mail address removed)
From: Me (e-mail address removed)
Subject: <dtml-var "var1">
<dtml-mime type="text/plain" encode="7bit">
Hi, please take a look at my resume.
<dtml-boundary type="application/octet-stream" disposition="attachment"
encode="base64" filename_expr="resume_file.getId()"><dtml-var
expr="resume_file">
</dtml-mime>
</dtml-sendmail>But how to do so in python only?Thanks alotChristian