title: How you send email with php where the sender has two emails?
body: <p>There is a standard that says that you can send from multiple email addresses. I mean the sender header can have multiple email addresses.</p>
  <p><a href="https://www.rfc-editor.org/rfc/rfc5322#section-3.6.2" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc5322#section-3.6.2</a></p>
  <p>I have tried different combinations of the <code>mail</code> functions but neither one worked.</p>
  <pre><code>&lt;?php
  $to      = 'nobody@example.com';
  $subject = 'the subject';
  $message = 'hello';
  $headers = 'From: webmaster@example.com, dat@teddy.com' . &quot;\r\n&quot; .
      'Reply-To: webmaster@example.com' . &quot;\r\n&quot; .
      'X-Mailer: PHP/' . phpversion();
  
  mail($to, $subject, $message, $headers);
  ?&gt;
  
  
  &lt;?php
  $to      = 'nobody@example.com';
  $subject = 'the subject';
  $message = 'hello';
  $headers = 'From: webmaster@example.com' . &quot;\r\n&quot; . 'From: dat@teddy.com' . &quot;\r\n&quot;
      'Reply-To: webmaster@example.com' . &quot;\r\n&quot; .
      'X-Mailer: PHP/' . phpversion();
  
  mail($to, $subject, $message, $headers);
  ?&gt;
  </code></pre>