OldHatt45
asked on
Add CC & Bcc when Using phpmailer
Trying to figure out how to use "CC" and "Bcc" when NOT On Win32 and NOT using SMTP as the transport for phpmailer.
Would really appreciate some help on this.
I'm not sure if I need to use "Headers"???
Would appreciate seeing the code for doing this.
Thanks
OldHatt45
Would really appreciate some help on this.
I'm not sure if I need to use "Headers"???
Would appreciate seeing the code for doing this.
Thanks
OldHatt45
>>I'm not sure if I need to use "Headers"???
Yes!
Look at example #2 on the manual page:
http://us2.php.net/manual/en/function.mail.php
That examples uses:
'Reply-To: webmaster@example.com' . "\r\n" .
You will need to change it to:
'CC: webmaster2@example.com' . "\r\n" .
'Bcc: webmaster3@example.com' . "\r\n" .
Yes!
Look at example #2 on the manual page:
http://us2.php.net/manual/en/function.mail.php
That examples uses:
'Reply-To: webmaster@example.com' . "\r\n" .
You will need to change it to:
'CC: webmaster2@example.com' . "\r\n" .
'Bcc: webmaster3@example.com' . "\r\n" .
ASKER
DooDah,
Your response was an example from the phpmailer download file. This I haveworking on a Win32 platform. My Problem is that YOU CANNOT USE AddCC and Addbcc if you are not on a Win32 platform.
Hielo,
Could You please show me the code to use for AddCustomHeader (because that's what it looked like you were trying to tell me) when using phpmailer??? What you have shown me is the stock email setup when not using phpmailer.
Thanks to both so far
OldHatt45
Your response was an example from the phpmailer download file. This I haveworking on a Win32 platform. My Problem is that YOU CANNOT USE AddCC and Addbcc if you are not on a Win32 platform.
Hielo,
Could You please show me the code to use for AddCustomHeader (because that's what it looked like you were trying to tell me) when using phpmailer??? What you have shown me is the stock email setup when not using phpmailer.
Thanks to both so far
OldHatt45
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hielo,
Thank You!
The points are yours.
OldHatt45
Thank You!
The points are yours.
OldHatt45
You will need to download the classes from http://phpmailer.sourceforge.net/ and then use some code like this :
require("class.phpmailer.p
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp1.site.com;smtp2.site
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@email.com";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@si
$mail->addBCC("joe@site.co
$mail->Subject = "Here is the subject";
$mail->Body = "This is the body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";