You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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='MyEmail@gmail.com', password='hunter2')
#sending the email
yag.send(to='MyOtherEmail@protonmail.com',
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.
The text was updated successfully, but these errors were encountered:
After some more troubleshooting I found the problem was with protonmail.
In gmail the attached file shows up, no problem.
In protonmail the attached file doesn't show up.
Interestingly there's some other stuff I found.
If I send it to my gmail, using the script, there's no issue.
If I forward that email from my gmail to protonmail, there's no issue.
I've also got automatic forwarding set up from my gmail to protonmail.
The email that was automatically forwarded from gmail to protonmail doesn't show the attachment.
If I forward the email from my own gmail to my own gmail, thus triggering the autoforward. There's no issue.
The issue seems to be specifically when sending an email from python using yagmail to protonmail.
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:
The output is as follows:
When opening the path (C:\Users\RegularUsername\Documents\Scripts\email\test.txt) it shows the txt file.
The text was updated successfully, but these errors were encountered: