Jump to content
Sign in to follow this  
trevorcr

Problem with Cc email headers

Recommended Posts

trevorcr    0
trevorcr

Executing this code in a hook assigned to a page does not send a mail to the Cc address;

 

<?php
    $to      = 'receiver@domain.net';
    $subject = 'Test mail template';
    $message = '
This is a test mail to check out various email options. Mail sent  using the string form of headers.
Webmaster';
    $headers = 'From: JAANC <noreply@jaanc.org>' . "rn"; // Set from headers
    $headers .= 'Cc: receivercc@domain.net' . "rn"; // Set cc headers
    mail($to, $subject, $message, $headers); // Send the email
echo "mail sent<br />";
?>
 

The received email headers have rn in the Cc address, see below;

 

To: trevorcrh@sbcglobal.net
Subject: Scholarship form submission
From: JAANC <noreply@jaanc.org>, "rnCc:fax9566"@sbcglobal.netrn
Message-Id: <20130313011227.BAF9A3561B21@s16389982.onlinehome-server.com>
Date: Tue, 12 Mar 2013 18:12:27 -0700 (PDT)

The above script works fine with the proper Cc if executed directly, like;

http://www.domain.org/email.php

 

Am I missing something in the framework to get this to work?

 

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there,
 

I don't know enough about php to be able to answer that unfortunately. However I have found this which may help, seems to be wrapping the code in tags.

 

http://www.sitepoint.com/forums/showthread.php?610751-PHP-mail-Multiple-BCC

 

Let us know if that helps, we'll check with a developer on the above code you put in in the meantime for you and post back to you when we hear back.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×