Jump to content

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( "[email protected],[email protected]". 

 

I want to hide the "[email protected]" email address.

 

I.e when the form is sent and "[email protected]" recieves the email, he or she doesnt see that the form was also sent to "[email protected]"

 

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( "[email protected],[email protected]", "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
https://forums.phpfreaks.com/topic/146305-solved-simple-sendmail-form-help/
Share on other sites

Thankyou for the reply...very prompt!

I am not familiar with headers.

Are there any websites you can recommend to help me discover more on this.

I have done a quick google search but all seem to be too advanced for a php beginner like myself.

 

Thanks again.

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 <[email protected]>\n";
$MsgHeader .= "Bcc: <[email protected]> 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;



?>

<?

 

  $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 <[email protected]>\n";

$MsgHeader .= "Bcc: <[email protected]> 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;

 

 

 

?>

mm you are sending it from @newsletter that email address it should not receive it the only ones that should be receiving it are

 

$email // the to  email

 

and webmaster@ should be receiving it they should both be receiving it from newsletter@

 

are both the others receiving it?

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.