I am trying to add a .pdf to an email as an attachment but I keep getting this error:
pywintypes.com_error: (-2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'Cannot add the attachment; no data source was provided.', None, 0, -2147352567), None)
The path is correct and the rest of my email code works perfectly using win32com. I have tried adding the other parameters for Attachments.add but the last two are optional.
Msg.Attachments.add(Source = "C:\\Users\User\Desktop\Python\ThisisaTestTitle.pdf", Type=olByValue)
Does anyone have experience with this error?
/rin front of the pathr"C://Users//User//Desktop//Python//ThisisaTestTitle.pdf".