kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.64k stars 263 forks source link

send attachment txt file fails #242

Closed leffss closed 2 years ago

leffss commented 2 years ago

Thanks for your great work on yagmail. I'm running yagmail-0.15.277 on python 3.9(both windows 10 and Linux(centos 7.9) have been tested).

I send attachments like this:

...
attachments = ['main', 'main.py', 'test1.txt', './test.png', 'test2.txt', 'test.zip', 'test.py', 'notest']
yag.send(to=receivers, cc=CC, subject=subject, contents=[body, html], attachments=attachments)

I test send mails to alimail(https://qiye.aliyun.com/),qqmail(https://mail.qq.com), 126mail(https://mail.126.com) and gmail.

This email arrives just fine,and all the attachments find in 126mail(https://mail.126.com) and gmail.

But without txt file attachments(test1.txt and text2.txt) in alimail(https://qiye.aliyun.com/) and qqmail(https://mail.qq.com).

And I did some troubleshooting on alimail(https://qiye.aliyun.com/), qqmail(https://mail.qq.com) and found:

Final,if use smtplib and email to send txt attachments, all the mailbox can receive the txt attachments.