healy787 Posted February 22, 2009 Share Posted February 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
gevans Posted February 22, 2009 Share Posted February 22, 2009 Look into headers, so ur sending with cc instead of bcc or the main send email Quote Link to comment Share on other sites More sharing options...
healy787 Posted February 22, 2009 Author Share Posted February 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 22, 2009 Share Posted February 22, 2009 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; ?> Quote Link to comment Share on other sites More sharing options...
healy787 Posted February 22, 2009 Author Share Posted February 22, 2009 This form works perfectly but only sends to one email address? Am i doing something wrong?? Thanks again Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 22, 2009 Share Posted February 22, 2009 can you post the script you have right now let me check it which email isn't receiving it? Quote Link to comment Share on other sites More sharing options...
healy787 Posted February 22, 2009 Author Share Posted February 22, 2009 <? $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; ?> Quote Link to comment Share on other sites More sharing options...
healy787 Posted February 22, 2009 Author Share Posted February 22, 2009 $MsgHeader = "From: The Rydon Inn <newsletter@rydon-inn.com>\n"; doesn't receive email Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 22, 2009 Share Posted February 22, 2009 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? Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 22, 2009 Share Posted February 22, 2009 try sending it to one of your email addresses @yahoo gmail or hotmail or a different email address from your user form if you receive it at webmaster and they receive it at the email address you entered it on the form then it is working Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 22, 2009 Share Posted February 22, 2009 if this topic is solved can you please mark it as solved please Quote Link to comment Share on other sites More sharing options...
healy787 Posted February 22, 2009 Author Share Posted February 22, 2009 Brilliant! Thankyou so much for your help! Everything is working perfectly. Sorry for the late reply. I had issues with my internet connection. Thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.