Open
Description
Thanks for making yagmail.
I'm running yagmail-0.15.277 on python 3.10.
I can't seem to attach a file to my email.
The email arrives just fine but without attachment.
In the code, shown below, I'm sending it to my protonmail account, also when I try to send to a gmail it also fails.
here's the code:
import yagmail
import os
textattach = os.path.join(os.getcwd(), 'test.txt')
print(textattach)
yag = yagmail.SMTP(user='[email protected]', password='hunter2')
#sending the email
yag.send(to='[email protected]',
subject='The subject is bla bla bla',
contents='Please find the text file attached',
attachments=textattach)
print("Email was sent")
The output is as follows:
C:\Users\RegularUsername\Documents\Scripts\email\test.txt
Email was sent
When opening the path (C:\Users\RegularUsername\Documents\Scripts\email\test.txt) it shows the txt file.
Metadata
Metadata
Assignees
Labels
No labels