Jump to content

Please help how to send Bcc or Cc email in my existing form


oavs

Recommended Posts

Hi

 

I want without modifying too much send  (Bcc and/or Cc) a copy of the email to the sender.

Here is my existing code which works but can't figure out the the copy to Bcc/Cc to the sender.

 

Can anyone please help.

 

<?
$to = "oavs@oavs.com.au";
//$to.= ",".$Email; 
$Cc = $Email;

$from_header = "Hello $Name,\n\n Please use following login details to see your artwork.\n URL: http://www.oavs.com.au\n Username: admin\n Password: enter \n\n\n You have entered following details.\n\nName: $Name $Surname,\n Company: $Company\n Phone: $Phone \n Email: $Email \n\n\n Accepts Terms and Conditions of viewing their logo commissioned to OAVS - Visual Concepts";


if($Name != "")
if($Surname != "")
if($Company != "")
if($Phone != "")
if($Email != "")
{
   //send mail - $subject & $contents come from surfer input
   mail($to, $Company, $from_header, $Phone, $Email);
   // redirect back to url visitor came from
   //header("Location: $HTTP_REFERER");
   header("Location: select.php");
}
  else
{
   print("<HTML><BODY>Error, no comments were submitted!");
   print("</BODY></HTML>");
}
?>

Link to comment
Share on other sites

Thanks for your reply

 

I did it slightly differently and now is working but I can not get the subject field now.

 

What I want is to send the recipient different Subject then one I am getting.

 

How would you do that? Appreciate your help heaps.

 

<?
$to = "abc@abc.com.au";
//$to.= ",".$Email; 
$headers = "From: support@abc.com.au" . "\r\n" .
	   "Subject: Your Login Details for your Art Work" . "\r\n" .
    	   "Reply-To: support@abc.com.au" . "\r\n" .
	   "bcc:$Email" . "\n" .
    	   "X-Mailer: PHP/" . phpversion();

$from_header = "Hello $Name,\n\n Please use following login details to see your artwork.\n URL: http://www.abc.com.au\n Username: admin\n Password: enter \n\n\n You have entered following details.\n\nName: $Name $Surname,\n Company: $Company\n Phone: $Phone \n Email: $Email \n\n\n Accepts Terms and Conditions of viewing their logo commissioned to OAVS - Visual Concepts";




if($Name != "")
if($Surname != "")
if($Company != "")
if($Phone != "")
if($Email != "")
{
   //send mail - $subject & $contents come from surfer input
  // mail($to, $Company, $from_header, "Bcc: $Email" . $headers);
   mail($to, $Company, $from_header, $headers);

   // redirect back to url visitor came from
   //header("Location: $HTTP_REFERER");
   header("Location: select.php");
}
  else
{
   print("<HTML><BODY>Error, no comments were submitted!");
   print("</BODY></HTML>");
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.