Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 亚马逊Ses SendRawEmail-未送达_Php_Amazon Web Services_Amazon Ses - Fatal编程技术网

Php 亚马逊Ses SendRawEmail-未送达

Php 亚马逊Ses SendRawEmail-未送达,php,amazon-web-services,amazon-ses,Php,Amazon Web Services,Amazon Ses,因此,我遇到了一个问题,电子邮件已发送但未送达! 这是我的密码: $phpMail = new PHPMailer(); $phpMail->addAddress($this->getToEmail(), $this->getToName()); $phpMail->setFrom($this->getFromEmail(), $this->getFromName()); $replyTo = $th

因此,我遇到了一个问题,电子邮件已发送但未送达! 这是我的密码:

    $phpMail = new PHPMailer();

        $phpMail->addAddress($this->getToEmail(), $this->getToName());
        $phpMail->setFrom($this->getFromEmail(), $this->getFromName());

        $replyTo = $this->getReplyTo();
        if($replyTo){
            $phpMail->addReplyTo($this->getReplyToEmail(), $this->getReplyToName());
        }

        $phpMail->Subject = $subject;
        $phpMail->CharSet = 'UTF-8';
        $phpMail->AltBody = $plainBody;
        $phpMail->Body = $htmlBody;
//        $mail->isHTML(true);

        $phpMail->preSend();

        $rawEmail = array(
            'Source'       => $this->getFromEmail(),
            'Destinations' => array($this->getToEmail()),
            'RawMessage'   => array(
                'Data' => base64_encode($phpMail->getSentMIMEMessage())
            )
        );

    $mail = $this->getSender();
    $command = $mail->getCommand("SendRawEmail", $rawEmail);
    /** @var Aws\Result $result */
    $result = $mail->execute($command);
此结果返回状态200

    {     "MessageId": "someid",     
           "@metadata": {         
           "statusCode": 200,         
           "effectiveUri": "https:\/\/email.us-east-1.amazonaws.com",        
           "headers": {             "x-amzn-requestid": "somegenerated id",             
           "content-type": "text\/xml",             
            "content-length": "338",             
"date": "Tue, 11 Aug 2015 07:33:03 GMT"         } 
但是如果我用SendEmail发送电子邮件,它就会被发送

   $mail      = $this->getSender();
        $message   = array();
        $message['Source'] = "{$this->getFromName()} <{$this->getFromEmail()}>";
        $message['Destination']['ToAddresses'][] = "{$this->getToName()} <{$this->getToEmail()}>";
        $message['Message'] = array(
            'Subject'    => array(
                'Data' => $this->getSubject()
            ),
            'Body' => array(
                        'Text'  => array('Data' => $this->getBodyPlain()),
                        'Html'  => array('Data' => $this->getBodyHtml())
            )
        );
        $replyTo = $this->getReplyTo();
        if($replyTo){
            $message['ReplyToAddresses'] = $replyTo;
        }
        try {
            $command = $mail->getCommand("SendEmail", $message);
            /** @var Aws\Result $result */
            $result = $mail->execute($command);
$mail=$this->getSender();
$message=array();
$message['Source']=“{$this->getFromName()}getFromEmail()}>”;
$message['Destination']['toaddress'][]=“{$this->getToName()}getToEmail()}>”;
$message['message']=数组(
“主题”=>数组(
“数据”=>$this->getSubject()
),
“Body”=>数组(
'Text'=>array('Data'=>this->getBodyPlain()),
'Html'=>array('Data'=>this->getBodyHtml())
)
);
$replyTo=$this->getReplyTo();
如果($replyTo){
$message['ReplyToAddresses']=$replyTo;
}
试一试{
$command=$mail->getCommand(“sendmail”,$message);
/**@var Aws\Result$Result*/
$result=$mail->execute($command);
我需要通过SendRawEmail发送信件,因为我需要设置自定义标题,但是如何调试我的问题,有什么建议吗???

所以我发现了一个错误 我需要发送没有base64_编码的电子邮件,因为我没有附件