【发布时间】:2026-01-03 06:00:02
【问题描述】:
(user_mail, ','.join(recipient), mail.as_string())
上面的代码产生了预期字符串的错误,但找到了元组。我应该如何解决这个问题?有什么解决办法吗?
【问题讨论】:
-
更多代码可以帮助我们为您提供帮助
-
recipient = [] db = MySQLdb.connect(host = "', user = ''', paswd=''', db=''') cursor = db.cursor() 游标。 execute('select email from user where email is not null') rows=cursor.fetchall() for item in rows: recipient.append(item)
-
我要求提供可以解释问题并帮助我们找到解决方案的代码。您可以发布发送电子邮件的代码,例如 smtplib.login 和其他代码。
-
mailServer.sendMail(user_mail, ','.join(recipient), mail.as_string()) 会这样吗?它说这条线有问题。我尝试从数据库中读取电子邮件并让 python 发送带有附件的电子邮件。
标签: python-2.7 email-attachments smtplib