title: Send a mail to formatted email address using Google Apps Engine and PHP
body: <pre><code>require_once 'google/appengine/api/mail/Message.php';
  
  use google\appengine\api\mail\Message;
  
  // ...
  
  $message_body = "...";
  
  $mail_options = [
      "sender" =&gt; "admin@example.com",
      "to" =&gt; "user@example.com",
      "subject" =&gt; "Your example.com account has been activated.",
      "textBody" =&gt; $message_body
  ];
  
  try {
      $message = new Message($mail_options);
      $message-&gt;send();
  } catch (InvalidArgumentException $e) {
      // ...
  }
  </code></pre>
  
  <p>I have used the above code for sending email from Google Apps Engine(for PHP Hosting)and its is working successfully.</p>
  
  <p>But i need a mail send to formatted email address like Contact Name </p>
  
  <p>I have try with the following code but it is not working and i got exception </p>
  
  <p>'InvalidArgumentException' with message 'Invalid 'to' recipient: '</p>
  
  <pre><code>$mail_options = [
      "sender" =&gt; "admin@example.com",
      "to" =&gt; "Contact Name &amp;lt;user@example.com&amp;gt;",
      "subject" =&gt; "Your example.com account has been activated.",
      "textBody" =&gt; $message_body
  ];
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$mail_options = [
      "sender" =&gt; "admin@example.com",
      "to" =&gt; "Contact Name &lt;user@example.com&gt;",
      "subject" =&gt; "Your example.com account has been activated.",
      "textBody" =&gt; $message_body
  ];
  </code></pre>
  
  <p>Is it possible?</p>