bryan
bryan

Reputation: 9369

Adding Reply-To header using Mail API

I'm trying to add a reply-to header using the Mail API in my google app engine. Right now I have the following but I am not quite sure how to get the custom headers in there. Could anyone help me out?

This is what I have as of now:

use \google\appengine\api\mail\Message;

try
{
  $message = new Message();
  $message->setSender("[email protected]");
  $message->addTo("[email protected]");
  $message->setSubject('Title');
  $message->setHtmlBody('Hi');
  $message->setTextBody('Hi');
  $message->send();
} catch (InvalidArgumentException $e) {
  echo "error";
}

Upvotes: 0

Views: 137

Answers (1)

Jose L Ugia
Jose L Ugia

Reputation: 6250

Use $message->setReplyTo("[email protected]");. Check line 320 in here.

Note that emails are also accepted like this "Reply To Name <[email protected]>"

Upvotes: 2

Related Questions