通过Outlook添加附件到电子邮件(Python)

时间:2016-04-04 10:54:09

标签: python outlook

我正在尝试将.pdf作为附件添加到电子邮件中,但我一直收到此错误:

RewriteRule ^/?dir/((?!index).+)$ /index.php [NC,L,QSA]

路径正确,我的电子邮件代码的其余部分使用win32com完美运行。我已经尝试为Attachments.add添加其他参数,但最后两个是可选的。

pywintypes.com_error: (-2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'Cannot add the attachment; no data source was provided.', None, 0, -2147352567), None)

有没有人遇到过这个错误?

1 个答案:

答案 0 :(得分:3)

“add”应大写:Msg.Attachments.Add(...