Reputation: 351
Please help me to set sender name with sender email id in Google App Engine to send mails using PHP. So that receiver can also be able to see sender name with sender email ID. The code i tried is:
$sender=$_POST['from_id']; // i used '[email protected]' Note : this email id is authenticated to send mails
$to=$_POST['to_id']; // i used '[email protected]'
$subject_of_mail=$_POST['subject_of_mail']; //test subject
$message_body=$_POST['message_body']; //test body
$mail_options = [
"sender" => $sender,
"to" => $to,
"subject" => $subject_of_mail,
"htmlBody" => $message_body
];
$message = new Message($mail_options);
$message->send();
So , how can i add sender name in sender option with sender email ID. I am using PHP with Google App Engine & mails are send successfully by using the above code but i am not able to add sender name with sender email id. Please help me out of this problem.
Upvotes: 0
Views: 748
Reputation: 6566
You cannot set the sender to any value you like. The sender address must be one of the following types:
see https://developers.google.com/appengine/docs/python/mail/sendingmail
Upvotes: 5