Send Email to multiple recipients from .txt file with Python smtplib

前端 未结 5 742
不思量自难忘°
不思量自难忘° 2020-12-06 08:23

I try to send mails from python to multiple email-addresses, imported from a .txt file, I\'ve tried differend syntaxes, but nothing would work...

The code:



        
5条回答
  •  旧时难觅i
    2020-12-06 08:39

    The sendmail function requires a list of addresses, you are passing it a string.

    If the addresses within the file are formatted as you say, you could use eval() to convert it into a list.

提交回复
热议问题