2017-04-01 19 views
10

Ben AWS SES üzerinden e-posta göndermek için çalışıyorum, ancak bu hatayı alıyorum:Hata: SendEmail operasyon: Yasadışı addres

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendEmail operation: Illegal address 

Zaten ben ve gönderiyorum e doğrulanmış .

import boto3 

client = boto3.client(
    'ses', 
    aws_access_key_id=AWS_ACCESS_KEY, 
    aws_secret_access_key=AWS_SECRET_KEY 
) 


response = client.send_email(
    Destination={ 
     'ToAddresses': [ 
      '[email protected]', 
     ], 
    }, 
    Message={ 
     'Body': { 
      'Html': { 
       'Charset': 'UTF-8', 
       'Data': 'This message body contains HTML formatting. It can, for example, contain links like this one: <a class="ulink" href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide" target="_blank">Amazon SES Developer Guide</a>.', 
      }, 
      'Text': { 
       'Charset': 'UTF-8', 
       'Data': 'This is the message body in text format.', 
      }, 
     }, 
     'Subject': { 
      'Charset': 'UTF-8', 
      'Data': 'Test email', 
     }, 
    }, 
    ReplyToAddresses=[ 
    ], 
    ReturnPath='', 
    ReturnPathArn='', 
    Source='[email protected]', 
    SourceArn='', 
) 

nasıl düzeltebilirim: Bu benim kodudur?

+0

E-posta adresi "geçerli" (çalışıyor) olsa da, SES için kabul edilebilir bir biçimde olmayabilir. Kodlama olmadan sadece 7 bit ASCII kullanılabilir. Adreste 127'den yüksek kod noktalarında unicode karakterler var mı (örneğin, é' veya 'ñ' gibi)? –

cevap

25

aşağıdaki kaldırmak deneyin:

ReplyToAddresses=[], 
    ReturnPath='', 
    ReturnPathArn='', 
    SourceArn='', 

Anlaşılan boş olamaz!

+1

AWS belgelerini düzeltmek zorunda kaldı, çok yanıltıcı http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html#sendEmail-property – Santthosh

İlgili konular