PHP mail() and Outlook

  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 473

Post 3+ Months Ago

This isn't really an issue but has anyone ever used the php mail and opened the email sent in outlook and seen the to email twice?

the email is a html email with headers
PHP Code: [ Select ]
 
// Basic setup
$to      = 'toemail@example.com';
$from    = 'fromemail@example.com';
$subject = 'test';
 
// Headers
$headers = array();
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
$headers[] = 'To: That Dude <toemail@example.com>';
$headers[] = 'From: That Chick <fromemail@example.com>';
$headers[] = 'Reply-To: That Chick <fromemail@example.com>';
$headers[] = 'X-Mailer: PHP/5.3.3';
 
$headers = implode("\r\n", $headers);
$message = 't<strong>es</strong>ting <i>for</i> <u>Stuff</u>';
 
mail($to, $subject, $message, $headers);
 
 
  1.  
  2. // Basic setup
  3. $to      = 'toemail@example.com';
  4. $from    = 'fromemail@example.com';
  5. $subject = 'test';
  6.  
  7. // Headers
  8. $headers = array();
  9. $headers[] = 'MIME-Version: 1.0';
  10. $headers[] = 'Content-type: text/html; charset=iso-8859-1';
  11. $headers[] = 'To: That Dude <toemail@example.com>';
  12. $headers[] = 'From: That Chick <fromemail@example.com>';
  13. $headers[] = 'Reply-To: That Chick <fromemail@example.com>';
  14. $headers[] = 'X-Mailer: PHP/5.3.3';
  15.  
  16. $headers = implode("\r\n", $headers);
  17. $message = 't<strong>es</strong>ting <i>for</i> <u>Stuff</u>';
  18.  
  19. mail($to, $subject, $message, $headers);
  20.  
  21.  


Really simple but in outlook the to looks like To: That, Dude; That, Dude I'm sure it is just another dumb microsoft thing. (seeing the email and matching to to a contact list or something). It doesn't really bug me just wondering
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 473

Post 3+ Months Ago

Excluding the to in the header fixes the issue
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6250
  • Loc: Seattle, WA

Post 3+ Months Ago

I was about to say, I've never seen the need to place to/from info in the headers like that.
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 473

Post 3+ Months Ago

It not really a need but its something I've always done. I think it make the email seem more personal lol since it shows up as the persons name instead of just their email

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.