Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Blind copying a form

the mail() function

Moderators: macek, egami, gesf

Blind copying a form

Postby Kwacker » Thu May 30, 2013 1:04 am

Hi,
Simple one this I hope! Have the form working fine but can't get a blind copy address to work. Here is the line of code I'm using to send the form .

mail("myemail@wherever.com", $subject, $message, $from);

Thanks in advance
Kwacker
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu May 30, 2013 12:47 am

Re: Blind copying a form

Postby pbs » Thu May 30, 2013 1:32 am

User headers

check additional headers from the link http://php.net/manual/en/function.mail.php
pbs
New php-forum User
New php-forum User
 
Posts: 39
Joined: Sat May 11, 2013 1:40 am
Location: Nashik, India

Re: Blind copying a form

Postby Kwacker » Thu May 30, 2013 2:11 am

Thanks for the pointer. I've added an additional header. See below. The form submits OK to the 4 emails it needs to go to but doesn't arrive at the Bcc email?

// Additional headers
$headers = "Bcc: myemail@email.com";

$from = "From: businessemail@business.com";

mail("$email, $email2, $email3, $email4", $subject, $message, $from, $headers);
Kwacker
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu May 30, 2013 12:47 am

Re: Blind copying a form

Postby Kwacker » Thu May 30, 2013 7:03 am

Hope someone can help as still can't get the Bcc working. Everything else works fine. Here is the full form. Thanks for any help where I'm going wrong:

<?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$event = $_POST['event'];
$school = $_POST['school'];
$urn = $_POST['urn'];
$contact = $_POST['contact'];
$email = $_POST['email'];
$phone = $_POST['phone'];

$todayis = date("l, F j, Y, g:i a") ;


$subject = ('Subject here');

$message = "$todayis [EST] \n
Dear $contact \n

Thank you for your booking

Yours sincerely,
My name


Event: $event\n
School: $school \n
Schools Unique Reference Number (URN): $urn \n
Key contact: $contact \n
Email address of key contact: $email \n
Telephone number of key contact: $phone \n

";

// Additional headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
$headers .= "Bcc: blindemail@whatever.com\r\n";

$from = "From: myemail@whatever.com";

mail("$email", $subject, $message, $from, $headers);


?>
Kwacker
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu May 30, 2013 12:47 am

Re: Blind copying a form

Postby developerahusain » Fri May 31, 2013 11:09 pm

You do it like this kwacker.

$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

developerahusain
any problem do revert,i'm there to help you friend
developerahusain
New php-forum User
New php-forum User
 
Posts: 36
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Blind copying a form

Postby Kwacker » Mon Jun 03, 2013 1:01 am

Hi thanks for the reply. I've amended the form (see below for the last section) however I still don't receive the email to the Bcc address?!

// Additional headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
$headers .= 'Bcc: blindemail@blind.com' . "\r\n";

$from = "From: sendersemail@.com";

mail("$email, $email2, $email3, $email4", $subject, $message, $from, $headers);
Kwacker
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu May 30, 2013 12:47 am

Re: Blind copying a form

Postby Kwacker » Wed Jul 10, 2013 7:37 am

Wise words but utterly f*king useless for my query.
Retard
Kwacker
New php-forum User
New php-forum User
 
Posts: 5
Joined: Thu May 30, 2013 12:47 am


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.