带有邮件服务错误的GAE InvalidArgumentException

时间:2016-07-04 21:10:40

标签: php email google-app-engine

这不是一个重复的问题,我已经尝试了很多GAE Php邮件发送,但下面的查找例外不是授权的电子邮件地址。我已尝试使用所有电子邮件ID。

ot sendexception 'InvalidArgumentException' with message 'Mail Service Error: Sender (info@mywebsite.in) is not an authorized email address.' in /base/data/home/runtimes/php/sdk/google/appengine/api/mail/BaseMessage.php:336 Stack trace: #0 /base/data/home/runtimes/php/sdk/google/appengine/api/mail/Message.php(148): google\appengine\api\mail\BaseMessage->handleApplicationError(Object(google\appengine\runtime\ApplicationError)) #1 /base/data/home/apps/s~acuteservice-1260/1.393973634644018844/contact.php(38): google\appengine\api\mail\Message->send() #2 {main} 

以下是我的代码,通过上面的InvalidArgumentException

<?php
use google\appengine\api\mail\Message;

$name=$email=$query="";

if($_SERVER["REQUEST_METHOD"]=="POST"){

   $name = $_POST["name"];
   $email = $_POST["email"];
   $query = $_POST["message"];

  require_once 'google/appengine/api/mail/Message.php';
    $mail_options = [
    "sender" => "info@mywebsite.in",
    "to" => "isashi4u@gmail.com",
    "subject" => "Subject",
    "textBody" => $query,
];

try {
    $message = new Message($mail_options);
    $message->send();
} catch (InvalidArgumentException $e) {
    echo "not send";
    echo $e;
}

}?>

有没有办法在&#34;发件人&#34;上提供默认设置? mail_option?

0 个答案:

没有答案