无法使用我的发件人ID发送AWS电子邮件

时间:2017-07-07 06:47:09

标签: php email amazon-web-services

我正在使用SNS发送AWS电子邮件。它工作正常,但我唯一无法找到的是如何通过amazonses.com id用我自己的电子邮件ID替换 no-reply@sns.amazonaws.com ..

我用过:

preRenderView

我还使用了许多其他选项,但每次通过$result = $client->publish(array( 'TopicArn' => $topicArn, 'Message' => 'testing...', 'Subject' => 'Test Msg', 'DisplayName'=>'abc@gmail.com' ));

发送电子邮件时

2 个答案:

答案 0 :(得分:2)

  

我可以删除电子邮件ID,如no-reply@sns.amazonaws.com。

不,你不能。

  

如果我有5个人订阅主题,那么每个人都可以看到电子邮件的所有收件人。

SNS不会将此视为发送给5个收件人的1封电子邮件。它发送5封单独的电子邮件,每封邮件发送1封。

对于这些功能,您需要使用简单电子邮件服务(SES),而不是SNS。

答案 1 :(得分:1)

DisplayName中设置属性setTopicAttributes

$result = $client->setTopicAttributes(array(
    // TopicArn is required
    'TopicArn' => 'string',
    // AttributeName is required
    'AttributeName' => 'DisplayName',
    'AttributeValue' => 'abc@gmail.com',
));

参数说明

AttributeName => (string)
The name of the attribute you want to set. Only a subset of the topic's attributes are mutable.    
Valid values: Policy | DisplayName | DeliveryPolicy

AttributeValue => (string)
The new value for the attribute.
相关问题