Jump to content

- - - - -

Problem with Cc email headers

email headers

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 trevorcr



  • Members
  • 24 posts

Posted 13 March 2013 - 07:12 PM

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


    $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.
    $headers = 'From: JAANC <noreply@jaanc.org>' . "\r\n"; // Set from headers
    $headers .= 'Cc: receivercc@domain.net' . "\r\n"; // 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;

Please Login or Register to see this Hidden Content


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


#2 James B†

James B


  • DMS Subscriber†
  • 5126 posts

Posted 14 March 2013 - 12:12 AM

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 [email] tags.


Please Login or Register to see this Hidden Content


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.