Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

Try this:

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

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

nCc: [email protected]

nX-Mailer: chfeedback.php 2.01:" );

Good Luck.

Garry

  • Author

Thanks Garry,

You code works great. I just realized that I wanted a blind cc. Do you have the code for that.

You always are a great help - Thank you - Sam

I think it is just:

nBcc: [email protected]

Good Luck.

Garry

p.s. You will find information about the PHP mail() function here:

http://au3.php.net/manual/en/function.mail.php

  • Author

Perfect, Thank you Garry

Sam

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);

}

I've never used the sockets method, I just use the mail() function. However, try this line:

fputs($connect, "Cc: [email protected]");

I took out the name and the <>.

Good Luck.

Garry

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.