Jump to content

This topic is 6959 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I was hoping someone could tell me how to include a cc email in the following code from FmWebSchool:

<?

$mailto = '[email protected]' ;

$subject = "Feedback Form" ;

$formurl = "http://www.yourwebsite.net/page1.htm" ;

$errorurl = "http://www.yourwebsite.net/emailerror.htm" ;

$thankyouurl = "http://www.yourwebsite.net/emailcomplete.htm" ;

$firstname = $_POST['firstname'] ;

$lastname = $_POST['lastname'] ;

$email = $_POST['email'] ;

$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {

header( "Location: $formurl" );

exit ;

}

$messagetext =" nn"."firstname=".$firstname

."nlastname=".$lastname."nemail=".$email."nn n" ;

mail($mailto, $subject, $messagetext, "From: "$name"

<$email>nReply-To: "$name"

<$email>nX-Mailer: chfeedback.php 2.01" );

header( "Location: $thankyouurl" );

exit ;

?>

Thanks in advance for your help - Sam

Posted

Gary,

I have the following universal email script, but for some reason the 'Cc' doesn't work.

The headers print out as if the 'Cc' should be working, but no 'Cc' is ever received.

Any thoughts on what might be missing?

function sendEmailWithSockets ($toName, $toEmail, $subject, $message)

{

global $SMTPServer, $SMTPPort, $emailFromName, $emailFromAddr, $contactEmailAddr;

$connect = fsockopen($SMTPServer, $SMTPPort, $errno, $errstr, 30) or die("$errno: $errstr");

$rcv = fgets($connect, 1024);

fputs($connect, "HELO {$_SERVER['SERVER_NAME']}rn");

$rcv = fgets($connect, 1024);

fputs($connect, "MAIL FROM:{$emailFromAddr}rn");

$rcv = fgets($connect, 1024);

fputs($connect, "RCPT TO:{$toEmail}rn");

$rcv = fgets($connect, 1024);

fputs($connect, "DATArn");

$rcv = fgets($connect, 1024);

fputs($connect, "Subject: $subjectrn");

fputs($connect, "From: {$emailFromName} <{$emailFromAddr}>rn");

fputs($connect, "To: {$toName} <{$toEmail}>rn");

fputs($connect, "Cc: Mark Lindal rn");

fputs($connect, "X-Sender: <{$emailFromAddr}>rn");

fputs($connect, "Return-Path: <{$emailFromAddr}>rn");

fputs($connect, "Errors-To: <{$emailFromAddr}>rn");

fputs($connect, "X-Mailer: PHPrn");

fputs($connect, "X-Priority: 3rn");

fputs($connect, "Content-Type: text/html; charset=utf-8rn");

fputs($connect, "rn");

fputs($connect, stripslashes($message)." rn");

fputs($connect, ".rn");

$rcv = fgets($connect, 1024);

fputs($connect, "RSETrn");

$rcv = fgets($connect, 1024);

fputs ($connect, "QUITrn");

$rcv = fgets ($connect, 1024);

fclose($connect);

}

Posted

Interesting.

The headers display correctly, but still no CC'd email is received.

When I take the message and do a reply-all, the cc'd address is mysteriously dropped.

I think I read somewhere (php.net) where the windows version was having problems with cc and bcc.

This topic is 6959 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.