2016-07-19 61 views
0

有没有验证电子邮件域或通过API发送验证的方法?我希望我的客户在我的网站上创建电子邮件广告系列时确认他们的电子邮件域。PHP亚马逊SES电子邮件验证

我正在使用PHP AWS SDK v2。 http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-ses.html

$mailbox_email = '[email protected]'; 

$aws_client = \Aws\Common\Aws::factory(array(
    'region' => 'eu-west-1', 
    'credentials' => array(
    'key'   => AWS_ACCESS, 
    'secret' => AWS_SECRET 
) 
)); 

$ses_client = $aws_client->get('Ses'); 

$ses_result = $ses_client->verifyEmailIdentity(['EmailAddress' => $mailbox_email]); 

// Set bounces, complaint, deliveries notification 
$ses_client->setIdentityNotificationTopic(array(
'Identity' => $mailbox_email, 
'NotificationType' => 'Bounce', 
'SnsTopic' => 'arn:aws:sns:eu-west-1:9:ses_bounces' 
)); 

$ses_client->setIdentityNotificationTopic(array(
'Identity' => $mailbox_email, 
'NotificationType' => 'Complaint', 
'SnsTopic' => 'arn:aws:sns:eu-west-1:9:ses_complaints' 
)); 

$ses_client->setIdentityNotificationTopic(array(
'Identity' => $mailbox_email, 
'NotificationType' => 'Delivery', 
'SnsTopic' => 'arn:aws:sns:eu-west-1:9:ses_deliveries' 
)); 

$ses_client->SetIdentityFeedbackForwardingEnabled(array(
'Identity' => $mailbox_email, 
'ForwardingEnabled' => false 
)); 

回答

0

在AWS SES的电子邮件域验证你需要做一个DNS的设置或者添加DKIM或TXT记录无法使用API​​除非域是在路线53做,你可以访问帐户。这是验证电子邮件域的方法。因此电子邮件域验证必须手动完成。

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html

您只能使用验证AWS SES API的电子邮件地址。

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html

+0

您好,我阅读文档http://docs.aws .amazon.com /秒es/latest/DeveloperGuide/verify-email-addresses.html,但没有找到任何关于如何重新发送电子邮件验证,如果他们没有收到电子邮件 – tonoslfx

+0

你想从控制台或从API重新发送? – error2007s

+0

我想通过API重新发送电子邮件验证 – tonoslfx

0

验证电子邮件

 //connect Amazon SES 
    $ses = new SimpleEmailService($this->AccessKey, $this->SecretKey,'email.eu-west-1.amazonaws.com'); 

    //Get verified mail list 
    $list = $ses->listVerifiedEmailAddresses(); 
    //verify email 
    $confirm = $ses->verifyEmailAddress('[email protected]'); 

设置主题验证电子邮件后

$ses = Aws\Ses\SesClient::factory([ 
      'credentials' => [ 
       'key' => $this->AccessKey, 
       'secret' => $this->SecretKey, 
      ], 
      'version' => 'latest', 
      'region' => 'eu-west-1' 
     ]); 


     $ses_client = $ses->setIdentityNotificationTopic(array(
      'Identity' => $email, 
      'NotificationType' => 'Bounce', 
      'SnsTopic' => 'arn:aws:sns' 
     )); 

     $ses_client = $ses->setIdentityNotificationTopic(array(
      'Identity' => $email, 
      'NotificationType' => 'Complaint', 
      'SnsTopic' => 'arn:aws:sns' 
     )); 
相关问题