2017-06-17 24 views
0

(user_mail, '' 连接(接收方),mail.as_string())序列项0:期望的字符串,元组找到

上面的代码产生wxpected字符串,但元组发现的错误。我应该如何解决这个问题?任何解决方案

+2

一些更多的代码,将有助于我们帮助您 –

+0

收件人= [] DB = MySQLdb.connect(主机=“ '用户= ''',paswd = '' 'DB = ''')光标= db.cursor()cursor.execute('select email from user where email is not null')rows = cursor.fetchall()for items in rows:recipient.append(item) –

+0

我要求的代码可以解释问题并帮助我们找到解决方案,您可以发送发送电子邮件的代码,如smtplib.login和其他代码 –

回答

0

您必须在字符串中指定收件人。以下是您可以指定收件人的示例。

user_email = "[email protected]" 
recipients = ["email1, email2, email3"] 
+0

我试过了,它说typeError:顺序项目3:预期的字符串,发现元组 –

+0

尝试编辑我希望这可以工作。我确实使用了列表,但它工作正常,但我不知道为什么它不适用于您的情况 –

+0

属性错误:str对象没有属性追加 –

相关问题