Graphic Design shadow to enhance presentation of images.
Graphic Design shadow to enhance presentation of images.

Web Design - Tips, Tricks and Programmng

PHP Forms and multiple e-mail recipients

Return to Forum Home Page

Forum

Return to Topic

Return to Topic

Login to Forum

Login to Forum

Register to access Forum

Register to access Forum

Previous Thread Return to Topic Next Thread
Author Message

Norm Jurgen

Norm Jurgen

Date Joined:
Jan 19, 2010

Posts:
56

Posted: Tue Jul 27, 2010 09:03 AM

Subject: PHP Forms and multiple e-mail recipients

When developing an on-line quotation form, an employment application a feedback form, or any form for that matter, the boss sometimes wants the forms content to not only be e-mailed to the intended person in a department but he/she also wants to receive it as a Copy: (cc), a Blind Carbon Copy: (bcc) or just be included in the To: List. Here are some tips on how that might be coded using PHP.
// To: List
// prepare the Subject, Body and Header separately.
// Everyone in this list receives the form's output.
//
$recipient= "Ronald Ducon <ronald@hobby-files.com>,Phil Utopia <phil@utopiamate.net>,Norm Jurgen <norm@17designs.com>";
$mail_sent = mail($recipient, $emailSubject, $emailBody, $emailHeader);

// CC:
$emailHeader = "From: $emailFrom\n"
. "MIME-Version: 1.0\n"
. "Content-Type: text/html; charset=\"ISO-8859-1\"\n"
. "Content-Transfer-Encoding: base64\n"
. "Cc: creative@17designs.com\n"
. "\n";
// Send e-mail and store returned value in variable
$mail_sent = mail($recipient, $emailSubject, $emailBody, $emailHeader);


// For Bcc use the immediate code above and replace Cc w/ Bcc

Enjoy!

Return to Forum Home Page

Forum

Return to Topic

Return to Topic

Login to Forum

Login to Forum

Register to access Forum

Register to access Forum