Jump to content

[SOLVED] simple sendmail form help!


healy787

Recommended Posts

Hi i am new to this forum.  I am very much a beginner when it comes to php. I have created this form after using many internet tutorials.  The form works perfectly and has done for some time. However, I need to alter the form if possible.

 

Currently i have "mail( "myname1@mydomain.com,myname2@mydomain.com". 

 

I want to hide the "myname2@mydomain.com" email address.

 

I.e when the form is sent and "myname1@mydomain.com" recieves the email, he or she doesnt see that the form was also sent to "myname2@mydomain.com"

 

Is this at all possible?

 

This is the current script i am using...

 

<?php

  $name = $_REQUEST['name'] ;

  $surname = $_REQUEST['surname'] ;

  $email = $_REQUEST['email'] ;

  $message = $_REQUEST['message'] ;

  $subject = $_POST['subject'] ;

  $mailing = $_POST['mailing'] ;

  $telephone = $_REQUEST['telephone'] ; 

 

 

  mail( "myname1@mydomain.com,myname2@mydomain.com", "Message from mydomain",

    "Name: $name $surname\nThis message was sent from (email address): $email\n\nTelephone number (if applicable): $telephone\n \n$subject\n\nMessage: $message\n\nMailing list information: $mailing\n", "From: $name $surname <$email>" );

  header( "Location: http://www.mydomain/mythankyoupage.html" );

?>

 

Thankyou in advance for your help

 

Any comments will be greatly appreciated.

Link to comment
Share on other sites

try something like this

<? 

  $name = $_REQUEST['name'] ;
  $surname = $_REQUEST['surname'] ;
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $subject = $_POST['subject'] ;
  $mailing = $_POST['mailing'] ;
  $telephone = $_REQUEST['telephone'] ;  


        header("Location: mythankyoupage.html");

$to = "$email";
$subject = "WEBSITE NAME Inquiry";
$MsgHeader = "From: WEBSITE NAME <myname1@mydomain.com>\n";
$MsgHeader .= "Bcc: <myname2@mydomain.com> r\n";
$MsgHeader .= "MIME-Version: 1.0\n";
$MsgHeader .= "Content-type: text/html; charset=iso-8859-1\n";
$MsgBody = "
<html>
<head>
<title>HTML message</title>
</head>
<body>
<table>
<tr><td align='left'><img src='http://www.website.com/pix/logo.gif'></td></tr>
</table>
<table style='padding-left:20px'>
<tr><td> </td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Name : $name</font></td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Surname : $surname</font></td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Email : $email</font></td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Message : $message</font></font></td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Mailing : $mailing</font></font></td></tr>
<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Telephone : $telephone</font></td></tr>
<tr><td> </td></tr>
</table>
<table>
<tr><td><font style='font-size: 10px' style='font-family: Tahoma, Arial'>This message, and any attachments, is intended only for the use of the individual or entity to which it is addressed, and may contain confidential, proprietary and/or privileged information that is exempt from disclosure under applicable law which is not waived or lost by any transmission failure. 
If the reader of this message is not the intended recipient or its employee, or agent responsible for delivering the message to the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication and any attachments hereto is strictly prohibited. 
If you have received this communication in error, please destroy this message. 
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of another person or entity. 
</font></td></tr>
</table>
</body>
</html>";
mail($to, $subject, $MsgBody, $MsgHeader);
?>



exit;



?>

Link to comment
Share on other sites

<?

 

  $name = $_REQUEST['name'] ;

  $surname = $_REQUEST['surname'] ;

  $email = $_REQUEST['email'] ;

  $message = $_REQUEST['message'] ;

  $subject = $_POST['subject'] ;

  $mailing = $_POST['mailing'] ;

  $telephone = $_REQUEST['telephone'] ; 

 

 

        header("Location: http://www.rydon-inn.com/thanks.html");

 

$to = "$email";

$subject = "Rydon Inn enquiry";

$MsgHeader = "From: The Rydon Inn <newsletter@rydon-inn.com>\n";

$MsgHeader .= "Bcc: <webmaster@rydon-inn.co.uk> r\n";

$MsgHeader .= "MIME-Version: 1.0\n";

$MsgHeader .= "Content-type: text/html; charset=iso-8859-1\n";

$MsgBody = "

<html>

<head>

<title>The Rydon Inn</title>

</head>

<body>

<table>

<tr><td align='left'><img src='http://www.website.com/pix/logo.gif'></td></tr>

</table>

<table style='padding-left:20px'>

<tr><td> </td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Name : $name</font></td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Surname : $surname</font></td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Email : $email</font></td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Message : $message</font></font></td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Mailing : $mailing</font></font></td></tr>

<tr><td><font style='font-size: 13px' style='font-family: Tahoma, Arial'>Telephone : $telephone</font></td></tr>

<tr><td> </td></tr>

</table>

<table>

<tr><td><font style='font-size: 10px' style='font-family: Tahoma, Arial'>This message, and any attachments, is intended only for the use of the individual or entity to which it is addressed, and may contain confidential, proprietary and/or privileged information that is exempt from disclosure under applicable law which is not waived or lost by any transmission failure.

If the reader of this message is not the intended recipient or its employee, or agent responsible for delivering the message to the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication and any attachments hereto is strictly prohibited.

If you have received this communication in error, please destroy this message.

Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of another person or entity.

</font></td></tr>

</table>

</body>

</html>";

mail($to, $subject, $MsgBody, $MsgHeader);

?>

 

 

 

exit;

 

 

 

?>

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.