PHP; receive the Contact form to multiple e-mail addresses

I would like to know how to configure my PHP to send the message from the contact page of the site to more than an email. Please find my course PHP coding below;

< body >
<? PHP
$name = $_POST ['name'];
$contact_number = $_POST ['contact_number'];
$email = $_POST ['email'];

address1 $= $_POST ['Address1'];
address2 $= $_POST ["address2"];
$town = $_POST ['city'];
$county = $_POST ['count'];
$postcode = $_POST ['postal code'];

$propertyType = $_POST ["propertyType"];
$propertyArea = $_POST ['propertyArea'];

$rearExt = isset($_POST['rearExt'])? "" Back to the floor extension: Yes ': "" back to the floor extension: No. ";"
$sideExt = isset($_POST['sideExt'])? "' Land extension side: Yes": "' land extension side: No."; "
$twoStoreyRear = isset($_POST['twoStoreyRear'])? "" Two-storey rear extension: Yes ': "" extension back to two floors: No. ";"
$twoStoreySide = isset($_POST['twoStoreySide'])? "" Two-storey side extension: Yes ': "" extension aside two floors: No. ";"
$loft = isset($_POST['loft'])? "" Loft conversion: Yes ":" ' Loft conversion: No. ";"
$newBuild = isset($_POST['newBuild'])? "" New generation: Yes ': "" new generation: No. ";"
$flat = isset($_POST['flat'])? "' Dish: Yes": "' dish: No."; "
$other = isset($_POST['other'])? "" Others: Yes ': "" others: No. ";"

$message = $_POST ['message'];

You can specify which email you want your contact form to be emailed here

$toemail = " " [email protected] "; "
$subject = "of the Web site;

$headers = "MIME-Version: 1.0\r\n";
$headers = "content-type: text/html;" charset = iso-8859-1\r\n ";
$headers = "from: $name <". "." $email. "' > \r\n";

$body = "name: $name\r\n.
E-mail: $email\r\n
Contact No.: $contact_number\r\n

Address1: $address1\r\n
Address2: $address2\r\n
City: $town\r\n
County: $county\r\n
Postal code: $postcode\r\n

Type of property: $propertyType\r\n
Property: $propertyArea\r\n

Back to the floor extension: $rearExt\r\n
Land extension side: $sideExt\r\n
Two-storey rear extension: $twoStoreyRear\r\n
Two-storey side extension: $twoStoreySide\r\n
Loft conversion: $loft\r\n
New generation: $newBuild\r\n
Dish: $flat\r\n
Other: $other\r\n

Message: \r\n
$message ';

If (! ereg ("^ [a-zA-Z0-9_] + @[a-zA-Z0 - 9-] + \.")) [a-zA-Z0 - 9-------.] + $"(, $email))"
{
echo "is not a valid email address.  "Please return to the.
. "previous page and try again. ';
"exit";
}

mail ($toemail, $subject, $body, $headers);
echo "thank you for sending your message."
? >
< / body >
< / html >

With the php mail function, you can do a few things of different. The simplest is to add email to the variable declaration.

Change this:

$toemail = "[email protected]";

To do this:

$toemail ="[email protected], [email protected]";

You can also concatenate the value in the variable for headers to add cc, bcc, etc., respond to e-mail headers. Currently, your code has a header. Well, there are three lines to declare the value of the $headers variable, but only the last line is defined, in fact replaced. This is because the lines after the first header variable are not concatenated. Take a look at your code below:

$headers = "MIME-Version: 1.0\r\n";

$headers = "content-type: text/html;" charset = iso-8859-1\r\n ";

$headers = "from: $name <".$email.">\r\n";

It should have one. for lines of same variable after the first definition for concatenating the value of the variable as $headers below. Search for php concatenate on google for more information.

$headers = "MIME-Version: 1.0\r\n";

$headers. = "content-type: text/html;" charset = iso-8859-1\r\n ";

$headers. = "from: $name <".$email.">\r\n";

The \r\n at the end of the code represents a line break in the header. You can concatenate, or add to the value of the variable to the header, adding another line as follows. Note the. in the next line, which says a concatenation of the value of the variable. A BCC field with two additional addresses added to the e-mail header. You can add another line for cc or any other e-mail header that you like. Who should you get.

$headers = "MIME-Version: 1.0\r\n";

$headers. = "content-type: text/html;" charset = iso-8859-1\r\n ";

$headers. = "from: $name <".$email.">\r\n";

$headers. = "BCC: [email protected], [email protected]';"

Tags: Dreamweaver

Similar Questions

  • Send form to multiple e-mail addresses

    I try to send a form to several addresses e-mail without much luck.  I started to look in the code, and I think I found the problem.

    / scripts/shape - < id > .php has a definition for the enamel with a 'from' and 'to' on the ground.  When I look in/scripts/form_process.php, line 128 in the function get_email_headers, it looks like it uses the variable 'a' in the field 'from '.  If you have several email address set to 'to', it would be a problem.

    If I just specify a unique address, everything works great.  It breaks only when I try to send the email to several addresses.  I have separate addresses with a semicolon, as the instructions say, but it always comes up with an error when I try to send.  I think I can fix the code, but I have to do whenever we update the site.

    It is under the management of the Emails/Set Default 'From' Email Site/System.

  • Error message in the contact form - PHP script does not

    Hi, excuse my bad English.

    I have an error message when the filled contact forms:

    They are: the form of the web server PHP script is missing or PHP is configured correctly on your web hosting provider. Check the script PHP of the downloaded form correctly, then contact your webhost to see the configuration of PHP.

    The support of my server application now:

    -What version of PHP is updated?

    - And what additional adjustments are required and more?

    Unfortunately only am the user, not a programmer and do not understand a lot.

    Can help you please? Maybe someone speaks German?

    Greetings from the Germany

    Andreas

    Here's the sceens!

    Here are the options to upgrade my server!

    But I don't know PHP what settings do I need?

    And what version of PHP used Adobe Muse to this day? 5.5? 7.0? or?

    Thank you

  • Image verification is received no error on the Contact form

    I get an error when you try to submit the contact form on my new Web site. It was built in Muse and is hosted in Business Catalyst. I use the Captcha of BC but get this error "error: an error has occurred." The image verification failed. If you think this is incorrect, please contact your administrator system or go back and submit the form. "I tried to resubmit the form several times, but continue to make the same mistake. The URL is www.gilbertsongaragedoors.com/contact.html. Help, please! I checked the settings on the screen in Muse, but everything seems to be correct. I'm not very familiar with Java script therefore am not able to check for errors there. The site was built using a Musegrid.com template. All my other forms seem to work well.

    Hi Shannon - the problem persists? I have sent the form and it was as expected.

    Thank you

    Mihai

  • Change 'new form submission' text on receipt of e-mail of the contact form.

    Hello

    One of our clients asked us to change the text that they receive when they receive an email from the contact form.

    It currently says: "new form submission.

    they want to tell him: ' West of the Moon ~ Ayr ~ site survey '


    We tried to change the name of the form, but does not change the object in the email, not the text in the email. Is it possible to do this?

    Hi Richard,

    Please check the php script to which the web form submits to that open with a text editor and change the verbiage you want here.

    PS - You will need to make these changes after each export of Muse as Muse will override them on each export/download.

    - Abhishek Maurya

  • Improvement of the contact form

    Hello, I have a contact form work on what will be my new Web site works, but that it's a first attempt is not yet quite right! and I'm not sure how to fix it / if its possible.

    the contact form is here: http://Reese-test.co.uk/contact.php

    (1) when you click "Send query" without any of the fields filled in, you get a pop-up as shown below (Fig 1), which is nice, but if you specify a name and click on "Send request" it takes you to the page contact_form_handler.php and poster simply errors in plain text, as shown below (photo 2).

    Untitled-1.jpgUntitled2.jpg

    What I would ideally is a pop-up for fields 'emailaddress' and the 'queryquestion' and that it will not not to contact_form_handler.php to show the other errors. This does anyone know why it does this?

    I use: gen_validatorv31.js for the validation that I have an example of forms site

    Here's the code for the contact_form_handler.php:

    <? PHP

    $errors = ";

    $myemail = ' [email protected] ';

    If (Empty($_POST['name']) |)

    Empty($_POST['emailaddress']) |

    Empty($_POST['queryquestion']))

    {

    $errors. = "\n error: all fields are mandatory;

    }

    $titlename = $_POST ['titlename'];

    $name = $_POST ['name'];

    $occupation = $_POST ['occupation'];

    $companyname = $_POST ["companyname"];

    $town = $_POST ['city'];

    $postocode = $_POST ['postal code'];

    $emailaddress = $_POST ["emailaddress"];

    $contactnumber = $_POST ['contactnumber"];

    $queryquestion = $_POST ['queryquestion'];

    If (! preg_match ())

    « / ^ [_a-z0 - 9-] + (\. [_a-z0-9-]+)*@[a-z0-9-]+ (-.)] [ a-z0 - 9-] +) * (\. [a - z] {2, 3}) / $i »,

    $emailaddress))

    {

    $errors. = "\n error: invalid email address ';

    }

    If (empty ($errors))

    {

    $to = $myemail;

    $email_subject = "site Web Query: $name";

    $email_body = "You have received a new request".

    "" Here are the details: title \n: \n $titlename name: $name \n Occupation: \n $occupation company name: \n $companyname postal code: \n $postocode Email: $emailaddress \n number of Contact: \n $contactnumber Message: \n $queryquestion ";"

    $headers = "from: $myemail\n";

    $headers. = "reply-To: $emailaddress";

    mail($to,$email_subject,$email_body,$headers);

    Redirect to the page "thank you."

    Header ('Location: thankyou.php "");

    }

    ? >

    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    < html >

    < head >

    Contact form < /title > < title > Manager

    < / head >

    < body >

    <! - this page is displayed only if there is an error - >

    <? PHP

    echo nl2br ($errors);

    ? >

    < / body >

    < / html >


    OK thank you Jon I worked on getting the pop-ups instead - your answer gave me an idea!

    Was the code I used on my contact.php:

    I changed it to the underside

    My contact form now works as it should. Thank you.

    Although I'm a little worried that you can't see my Web site. What browser are you on? I tested it on different PCs on IE, Firefox, Safari and Chrome and all is well, I can see? Stupid question, but you cleared your Cache?

  • The contact form question

    Recently created a new site, but the contact form is back with errors when downloading.

    1 WARNING

    PHP mail can be disabled or misconfigured web server. These forms can not send email. Contact your Web host or administrator of the Web site on the correct configuration of PHP mail.

    • I checked the site to another host and it works fine,
    • The host of to this Web site is responsible is nearly host
    • I'm currently in talks with support here but not get anywhere quickly.
    • I looked on the forum found pieces of the info, but nothing to solve this problem.
    • I've updated the nearly host php to version 5.6

    Can anyone help?

    Kind regards

    Grant

    Hey Grant,

    Please refer to the troubleshooting doc for the widget of forms used on third party widgets: Troubleshooting Muse form used on the servers of third party Widgets

    If we run the diagnostics, the results we get are:

    Kind regards

    Akshay

  • Problems with the contact form

    Good day to you all,.

    im a total newbie-muse.

    That said: I have some problems with a contact form I've tried to insert into my homepage.

    When I try to download it via ftp to our server muse tells me that there are some problems with the configuration of PHP.

    In addition to the contact form, the site works very well.

    I tried to change the version of php on our server at 5.6, but it still doesn't work.


    Any ideas?

    Thanks in advance and greetings from the Germany.

    You can consult this document: Troubleshooting Muse form Widgets used on the third... | Adobe Community

  • What system use Muse to make the contact form widget work?

    Hello

    I'm a graphic designer working with a coder to create a new website using Muse. My coder was asked what Muse system uses to make the widget of the contact form.  Looking at the code of the page looks like ASP dot net and when the user clicks the button the form data is sent to a script called "FormProcessv2.aspx". If so what version?  (for example, ASP 1.0 or 2.0 or 3.0) Muse use "dot net" or ".NET" or similar in the documentation? If so then would you say what version (1.0 or 2.0)?

    Can someone help me with these questions?

    Thank you very much

    Emma

    It is unclear what the URL/code page you look at? Muse does not ASP. Muse uses PHP for form processing and relies on PHP sendMail to send the form as an e-mail information.

  • Attach text Yes/No boxes in the Contact form

    How can I add text to a contact form which will be yes/no boxes that go hand in hand? For now I have questions in plain text format, but since they are not part of the contact form, I do not think this information we will roll to the e-mail that I receive when someone clicks on the submit button.

    Yes, I figured out how to add a checkbox for the widget field and changed "label of the box" or not. But I want to know how to ensure that the question associated with the YES / no checkboxes should be included in the notification of form submission. I guess a text box gross will not be included in the notification of form submission, so is it possible to add text without a field of text associated with a contact form?

  • Need to email entered identical on the contact form

    Hi guys out there.

    Part 2 question;

    I use Dreamweaver CS5 and have a couple of contact forms on my website set up. They work fine, but lately have been inundated with spam. For most simple robots automated that waste my time. I don't want to install a captcha configuration.

    I currently require people enter their email twice, in case they make a typing mistake, and while both fields are mandatory, it allows them both contain different inputs, for example, send 1 can be [email protected] and the 2nd may www.spamlink.com... etc. I think that if they had to be the same, he would fix most of the problems.

    Here's some of my GEC

    < do action = "" / xxx - example.pl "method ="post"name = 'Image of inquiry' id = 'Image of inquiry' >"

    < input type = "hidden" name = "subject" value = "My Site print order form" / >

    < input type = "hidden" name = "required" value = "email, email 2, name of the customer," / >

    and then this

    < td align = "left" valign = "middle" > < span class = 'Form' > e-mail address: </span > < table >

    < td align = "left" valign = "middle" > < input name = "email" type = "manual" id = "Customer Email" size = "20" maxlength = "30" / > < table >

    < /tr >

    < tr align = "left" valign = "top" >

    < td align = "left" valign = "middle" > < span class = 'Form' > re - enter email: </span > < table >

    < td align = "left" valign = "middle" > < input name = "email 2" type = 'manual' id = "E-mail Client 2" size = "20" maxlength = "30" / > < table >

    What I want is to require that the entries in these two areas of the same (and both be e-mail addresses).

    Also, I wish I had a simple question such as 'what is four plus five' where the user must enter "9" to the form to cross. Or really do anything where I need a specified entry.

    I'm not a person of php or javascript or anything, so if anyone can help me to get this working, I'll probably need very basic and specific info. else loses me. I tried different 'honey pot' methods and nothing seems to work properly.

    Thank you very much

    See you soon


    Carl

    I think I'm...

    Sort of. Client-side means that the script is executed in the browser. Since this can easily be disabled/modified, it is not robust enough for real-world validation. Server-side means that the script is run on the server, making it invisible and much less vulnerable to hackers.

    I guess I don't understand is why is not a product like DW

    to simply manage this sort of thing if they have forms"as part of it of coding.

    You must apply to the product development group. There are an infinite number of ways to process forms, and it's a slippery slope when you start to add some features and let others.

    Yet once again, take a look at formstogo, it'll probably help with your problem.

  • Having problems with spam on the contact form

    I typed what one to have Adobe remove so I could type all of this once again to submit it in time. So, this will be the shorter version.

    Basically I get spam from the contact form on a page cataylst hosted non-commercial (hosted by bluehost). I have 35 other muse not sites on other systems and in 8 years never received a spam message. Now with Muse I get several a week only after a few months to live. If something goes really. Adobe has been no help and basically told me they can only help if it's the cataylist Business.

    Have you guys found any ways around that? I know that wordpress sites have apps to add to help him, but I didn't know if Muse was something like this, or code that could be entered to help him. I'd avoid CAPTCHA if humanly possible because I think that they look horrible on the websites and I also want low barriers for customers as possible to present real contacts.

    All thought is appreciated. Thank you

    Refer to Zak response to your similar post here - http://forums.adobe.com/message/6129694#6129694.

    Thank you

    Vinayak

  • My customer is having a serious problem with the Contact form Widget

    My Client is to have a serious problem with the Contact form Widget that I can't seem to figure out how to fix.

    I created a website for a client and inserted a widget of Contact form on the "Contact us" page Whenever someone uses the form, e-mail receive my client shows my e-mail address as the sender. So when they "meet" the email, the response is sent to me and not the person who sent the original message. This creates a major problem in that I get flooded with answers e-mail while my client's potential customers go without a response.

    When I look at ' Site Manager > email system > Workflow information > e-mail address on the site administration Console, it displays my e-mail information. This is what needs to be changed?  If this is the case, what needs to be placed in this field for the email address of my client receives presents information email senders in the field "from".  My client wants to be able to click on reply and the message sent to the right side. They would be very angry if should be cut and past shippers Correo electronico of the body text on all the contacts they receive.

    Their feeling is that if I can't find a way to make the contact form works as it should, then there is no need for them.

    Can someone help me understand this? I really don't want to disappoint my first client.

    Congratulations for your first customer! =>

    Looks like you can have your email in places where your customers email should be.

    Here are the places you need to change your e-mail address.

    First adjust the answering of your web form is your customer email. Screenshot: http://screencast.com/t/YWiZZ30E0jE and http://screencast.com/t/u4t69anTLR

    Second set Emails to come your clients e-mail system. Site management > system email > set default "from" e-mail. Screenshot: http://screencast.com/t/EAr2sfXk

    I always go through each email system and check the e-mail address after you set the default value. I found that it doesn't always change them for some reason any. Note: If you are on a lower to webCommerce plan your list can be shorter than what is shown.

    Make sure that the email you the list of customers is also an email they want in public.

    Also provide information on the TSA that thetrickster888 is good information.

    I hope this helps.

    Lynda

  • Change of destination for the Contact form email

    Hi all

    I configured my portfolio page and was delighted to learn that you could add a form of contact rather than having to reveal your email address in the world. It is just an issue.


    The email address that I use for my Adobe ID is not my main job email, I use a secondary address. Whenever I created the contact form he began to send emails to my secondary address, when in fact, I want that they arrive in my Inbox from hauptwerk.


    I changed my Adobe ID to my primary address to see if it works, but no joy. emails are always landing in the wrong Inbox.

    My question: is some way you can change your email address for portfolio Adobe so that submitted emails a contact form come in a different Inbox?

    Thank you

    Angus

    Hey Angus! You can change the e-mail address that you want to use by following these steps:

    1. place the cursor on the contact form and click on the pencil icon that appears in the upper left corner

    2. click on customize

    3. then click on the Options tab of the form

    4 change email address

    5 valve

  • IP address in the contact forms

    I realized the contact forms created in Muse when e-mailed automatically contains the IP address of the user. Because of the laws on the confidentiality of the data, we do not want the IP address to be transmitted. It's showing us the incoming mail:

    "Von ubermitteltes Formular Web site: www.xxx.de .

    "Visitor IP address: xxx".

    How can we prevent the contact form or email generated to transmit the IP address of the user?

    It's a thing, what you need to do your company is something completely different, if you say here, 'it is not legal. Normally the IP address is very important information to identify the sender.

Maybe you are looking for