WeCodeThings Library
Library of code bits
Glossary    Contact Us
Need a web designer? visit WeCodeThings.Com for more details
Search  
   
Browse by Category

WeCodeThings Library .: PHP .: PHP Mail Function Multiple Emails, People, To, or Recipients in Email PHP



PHP Mail Function Multiple Emails, People, To, or Recipients in Email PHP

When constructing the mail function with multiple Emails, People, To, or Recipients in PHP, be sure to use this syntax. It allows you to send multiple emails to multiple people during the mail function.

 

  1. $name = $firstname;     //senders name
  2.  
  3. $name .= ' '.$lastname;      //senders name
  4.  
  5. $mail = $email;    //senders e-mail adress
  6.  
  7.  
  8.  
  9. $recipient  = "recipientone@wecodethings.com" . ", "     //recipients
  10.  
  11. $recipient .= " recipienttwo@wecodethings.com" . ", "
  12.  
  13. $recipient .= "recipientthree@wecodethings.com";
  14.  
  15.  
  16.  
  17. $mail_body = $firstname.' '.$lastname.' Said, <br /> '.$comment.' <br />Phone: '.$phone; //mail body
  18.  
  19.  
  20.  
  21. $subject = 'Contact Form.'; //subject
  22.  
  23.  
  24.  
  25. $headers  = 'MIME-Version: 1.0' . "\r\n";
  26.  
  27. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  28.  
  29.  
  30.  
  31. // Additional headers
  32.  
  33. $headers .= 'To: recipientone@wecodethings.com <recipientone@wecodethings.com>, recipienttwo@wecodethings.com <recipienttwo@wecodethings.com>, recipientthree@wecodethings.com < recipientthree@wecodethings.com ' . "\r\n";
  34.  
  35. $headers .= 'From: no_reply@wecodethings.com <WeCodeThings>' . "\r\n";

 



How helpful was this article to you?

Related Articles

article How to use cfmail with Godaddy using a try | catch
<cfparam

  4-7-2009    Views: 1226   
article Flex 3 Get Data from a CFC ColdFusion using bindable result handler function
More about creating a remote object and...

(No rating)  4-21-2009    Views: 888   
article How to include a file with PHP using the includes and require function
The include() Function Simplest way to...

(No rating)  4-10-2009    Views: 417   

User Comments

Add Comment
No comments have been posted.




.: Powered by Lore .:Code by WeCodeThings Website Design and Development