2014-01-07 37 views
2
msg = MIMEMultipart() 
    msg['Subject'] = 'Some subject' 
    msg['From'] = '[email protected]' 
    msg['Date'] = cur_date.isoformat(sep= ' ') 
    msg['To'] = COMMASPACE.join(['[email protected]', '[email protected]']) 

    part = MIMEBase('application', 'octet-stream') 
    payload = "some generated payload message" 
    part.set_payload(payload) 
    Encoders.encode_base64(part) 
    part.add_header('Content-Disposition', 'attachment; filename=%s.csv' % yesterday.strftime('%Y%m%d')) 
    msg.attach(part) 

    s = smtplib.SMTP(host='email-smtp.us-east-1.amazonaws.com', port='587') 
    s.ehlo() 
    s.starttls() 
    s.login('user', 'psw') 
    print("Sending mail..") 
    s.sendmail('[email protected]', ['[email protected]', '[email protected]'], msg.as_string()) 
    s.quit() 
    print("Mail Sent") 

我发送一封电子邮件,附带通过python使用亚马逊ses。我收到以下错误 -无法通过蟒蛇中的亚马逊网站发送邮件

smtplib.SMTPDataError: (554, 'Message rejected: Email address is not verified.') 

我的“发件人”地址验证和电子邮件从作为JAVA代码的其他部分发送与同一组电子邮件地址的工作。我错过了什么,就好像我使用'smtp.gmail.com'和我的凭据一样。

+0

采取从SMTP流量原始网络转储从工作的Java应用程序,并把它比作什么Python做,并当场差异。 –

回答

相关问题