e-mail, Web site contact form

I'm creating a Web site with a page "contact us" (html), which calls for a form to be submitted by electronic mail through the browser. However, it will not send the email. Can someone please?

< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

& lt;? PHP

If ($mode == & quot;) Email & quot ;) {

first of all, define your four mail function fields

$recipient = & quot; [email protected] & quot;

$subject = & quot; online survey in your area & quot;

$content = & quot; & quot;

$header = & quot; From: YourSurvey <[email protected]> \n & quot;. & quot; Answer: [email protected]\n & quot;

send it now

mail ($recipient $subject, $content, $header);

}

? & gt;

" < html xmlns =" http://www.w3.org/1999/xhtml ">

< head >

< meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

"< link href="file:///C|/Users/tam/Desktop/PSStyles.css "rel ="stylesheet">

< title > Contact form we < /title >

< / head >

< body >

< div id = 'wrapper' >

< div id = "header" >

< div id = "logo" >

< h1 id = "sitename" > < span > < img src = "Images/thanks" alt = "logo" width = "270" height = "105" / > < / span > < / h1 > "

< h2 class = "description" > home for pampered pets. < / h2 >

< / div >

< div id = "headercontent" >

Happy Pets-timonials < h2 > < / h2 >

< p > my landlord took me to Sandy for a bath and I had the treatment 'spaw '. -Rover < /p >

< / div >

< div id = "sitecaption" > Satisfaction < span class = 'bigger' > secured </span > < / div >

< / div >

< / div >

< div id = "ripmain" >

< div id = "minuet" >

< nav >

< ul id = "menu bar" >

< li > < a href = "file:///C|/Users/tam/Desktop/Tam Website/PSTP.html" > home < /a > < /li >

< li > < a href = "file:///C|/Users/tam/Desktop/Tam Website/AboutUs.html" > on < /a > < /li >

< li > < a href = 'file:///C|/Users/tam/Desktop/Tam Website/Location.html' > location < /a > < /li >

< li > < a href = "GroomingServices.html" > grooming < /a > < /li > ""

< li > < a href = "file:///C|/Users/tam/Desktop/Tam Website/ContactUs.html" > contact us < /a > < /li >

< /ul >

< / nav >

< / div >

< / div >

< script type = "text/javascript" >

function checkForm (form)

{

If (this.firstname.value == "") {}

Alert ("Please enter your first name in the form");

This.FirstName.Focus ();

Returns false;

}

If (this.lastname.value == "") {}

Alert ("Please enter your first name in the form");

This.LastName.Focus ();

Returns false;

}

If (this.email.value == "" |!) This.valid_email. Checked) {}

Alert ("Please enter a valid Email address");

This.email.Focus ();

Returns false;

}

If (this.comments.value == "") {}

Alert ("Please enter your comments in the form");

this.Comments.focus ();

Returns false;

}

Alert ("Success!  The form has been completed, validated and is ready to be submitted... ») ;

Returns false;

}

< /script >

< are method = "POST" action = "contact.php" onsubmit = "return checkForm (cela;" > "

< fieldset >

the legend <>form Contact us < / legend >

< p > first name: < input type = "text" size = "32" name = "firstname" onchange = "this.value = this.value.replace (/ ^ \s + | \s + $/ g,"); " valid_name.checked = this.value; ">

< /p >

< p > family name: < input type = "text" size = "32" name = "lastname" onchange = "this.value = this.value.replace (/ ^ \s + | \s + $/ g,"); " valid_name.checked = this.value; ">

< /p >

< p > E-mail: < input type = "text" size = "32" id = "email" name = "email" onchange = "if (this.value! = ") callAjax ('checkEmail', this.value, this.id); ">

< /p >

< div id = "rsp_email" > <!--> < / div >

< td > comments: < table >

< td >

< = cols 'comments' textarea name = "40" rows = "3" = "virtual" wrap

onblur = "checkTextArea (this, 100);" > < / textarea >

< table >

< p > < input type = "submit" value = "Submit" > < / p >

< / fieldset >

< / make >

< div id = "footer" > & copy; Copyright 2015 life, Inc. All rights reserved. < br >

Opening hours: Mon - Fri: 06:00 to 23:00. Sat & Sun: 08:00 to 22:00 < br >

' Links to other local services: < li > < a href = " http://www.hillsidevetclinic.org "> Veterinary Clinic of Hillside < /a > < /li > < li > < a href =" http://www.PetSmart.com "> stores PetSmart < /a > < /li > < li > < a href =" http://www.poochhotel.com "> Hotel pooch < /a > < /li > < / div > .

< / body >

< / html >

Here is the contact.php file

<? PHP

/ * Set e-mail recipient * /.

$myemail = " " [email protected] "; "

/ * Check all form entries using check_input * /.

$firstname = check_input ($_POST ["firstname"], "Enter your name");

$lastname = check_input ($_POST ['name'], "Enter your name");

$subject = check_input ($_POST ['subject'], "write a topic");

$email = check_input($_POST['email']);

$comments = check_input ($_POST ['comment'], "write your comments");

/ * If the email is not valid, see the error message * /.

If (! preg_match ("/ ([\w\-] +------@[\w\-] + \.)")) [\w\-]+)/ "(, $email))"]

{

show_error ("invalid email address");

}

/ * If the URL is not valid game $website unladen * /.

If (! preg_match ("/ ^ (https?: \ \/+[\w\-]+\.)")) [\w\-]+)/i "(, $website))"]

{

$website = ";

}

/ * We will prepare the message for e-mail * /.

$message = "Hello!"

Your form has been submitted by:

Name: $firstname

Last name: $lastname

E-mail: $email

Comments:

$comments

End of message

";

/ * Send the message using the mail() function * /.

mail ($myemail, $subject, $message);

/ * Redirect the visitor to the thank-you page * /.

Header ('Location: thanks.html');

Exit();

/ * We used functions * /.

function check_input ($data = $problem ")

{

$data = trim ($data);

$data = stripslashes ($data);

$data = htmlspecialchars ($data);

If ($problem & & strlen ($data) == 0)

{

show_error ($Problem);

}

return $data;

}

function show_error ($myError)

{

? >

< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

" < html xmlns =" http://www.w3.org/1999/xhtml ">

< head >

< meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

< title > Untitled Document < /title >

< / head >

< body >

< b > please correct the following error: < /b > < br / >

<? PHP echo $myError;? >

< / body >

< / html >

<? PHP

Exit();

}

? >

The mail function needs a mail server to run. Normally, this server is not present on the local system. If you download from the site to a host with the server, you will find that it will work.

Tags: Dreamweaver

Similar Questions

  • I can't load up a book cover of my images for a web site request form

    I can't load up a book cover of my images for a web site request form. Is there a method to do this?

    Hello

    This can depend on the configuration of the web site form. If can accept only text, may have a limit on the maximum characters lol, etc. Some Web site forms do not accept entries stuck, just live by typing.

    I suggest you contact the website for advice.

  • How can I send an e-mail using a contact form if my host requires SMTP authentication information?

    My company Web site is built in Muse and I'm using the standard contact form. My hosting provider requires SMTP authentication to send an email, and there is no way to enter the SMTP credentials in the contact form. Thus, my contact form doesn't send emails. I can't change my hosting provider and I don't want to give up Muse and re-create the company site in another program. What are my work around options to send an email using Muse?

    Help, please!

    This can be a problem in the settings of your hosting/cPanel as it is the main reason, contact forms are not sent. Apart from that your MX records are correct, there is another hidden in cPanel parameter that affects the email which is the "MX" entrance in cPanel e-mail settings.

    1. Select 'Manage' for "Accommodation" on your product page
    2. Go in cPanel
    3. Scroll down (page 3/4) to the Email (you can see many icons of e-mail in this section)
    4. Select "MX Entry.
    5. New Page loading
    6. In the drop-down list, select the field, problems of e-mail with
    7. Once selected, look at the option button and see which is the default
    8. Make sure you have selected "remote server".
    9. Click Save
    10. Further spread will last from 10 minutes to 2 hours
    11. Fix of a problem
  • 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

  • Arabic text just "?" when mailed using Flash contact form. There?

    Hi there, the guru of the Flash.

    I have this pros with a flash contact form sending Arabic text flash using php to my mailid. The Arab side come from? While the English part is really fine. Can someone help me with this? I ran all over the web for it but he hard work very well...

    This is my flash code-

    // Loading Variables and Settings
    stop();
    error_clip._alpha = 0;
    System.useCodepage = true;
    send_btn.onRelease = function() {
         my_vars = new LoadVars();
         my_vars.namex = name_txt.text;
         my_vars.email = email_txt.text;
         my_vars.msg = msg_txt.text;
    
         // If text fields are not blank the message will be sent
         if (my_vars.namex != "" and my_vars.email != "" and my_vars.msg != "") {
              my_vars.sendAndLoad("send_mail.php",my_vars,"POST");
              gotoAndStop(2);
              // Else if text fields are blank a warning message will appear
         } else {
              error_clip._alpha = 100;
         }
         // After the message is sent the user will be redirected to frame 3
         my_vars.onLoad = function() {
              gotoAndStop(3);
         };
    };
    // If you click on another field "All Fields Required" will dissapear
    name_txt.onSetFocus = email_txt.onSetFocus=msg_txt.onSetFocus=function () {
         if (error_clip._alpha != 0) {
              error_clip._alpha = 0;
         }
    };
    
    clr_btn.onPress = function() {
    
         msg_txt.text = "";
    
    };
    

    And here is the PHP part.

    <?php
    // Loading Variables
    $name = $_REQUEST["namex"] . "\n\n";
    $email = $_REQUEST["email"];
    $message = $_REQUEST["msg"] . "\n\n";
    // The \n character means New Line
    
    // Mixing all variables, including IP
    $full_message ="From ".$name.",  ".$email."    ".$message;
    
    // Remove the backslashes that appears when entering characters like " or '
    //$name = stripslashes($name); 
    //$email = stripslashes($email); 
    //$message = stripslashes($message); 
    
         $subject = "Tell Me!!";
         $from = $name;
         $headers  = "From: $from\r\n"; 
         $headers .= "CC: [email protected]\r\n";
    
         
    
    
         
          $headers .= "Content-Type: text/html; charset=utf-8"; 
          
          $body = $full_message;
    
         /*$body = "<html><head><title>Untitled Document</title><meta http-equiv=Content-Type content='text/html; charset=iso-8859-1'></head><table width=440 border=0 align=center cellpadding=6 cellspacing=1 bgcolor=#000000>  <tr bgcolor=#000000><td colspan=2 nowrap><font color=#FFFFFF size=2 face='MS Sans Serif'><B>ONLINE FEEDBACK</B></font></td>  </tr>";
         $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>Name<font size=1>:</font></font></td>    <td width='68%'><font size=2 face='MS Sans Serif'><B>" . $name . "</B></font></td></tr>";
         $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>E-mail/Website</font></td><td><font size=2 face='MS Sans Serif'><B>" . $email . "</B></font></td></tr>";
         $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>Message</font></td><td><font size=2 face='MS Sans Serif'><B>" . $message . "</B></font></td></tr>";
         $body .= "<tr><td nowrap valign=top> </td><td> </td></tr></table></body></html>";*/
         
    
         
         // Sending the mail
    // Note: Don't forget to change "[email protected]" to receive the mail from contact form
         mail("[email protected]", $subject, $body, $headers);
    
    ?>
    

    There were several probs like this online and I couldn't find the right solution. Can you please help me? The form works completely in the English text file. No probs in the code, but the Arab side is very delicate.

    Thank you very much in advance.

    In the text fields, do you have embeded the Arabic language?

  • Download - e-mail, Web sites, etc.

    I have Windows Vista and am not able to find the files after download.

    I get the message: "Windows cannot find"C:\"... "" "I tried to download e-mail (I am able to see and then print to PDF as well) or a Web site.
    Any help is appreciated!

    Hello

    Thank you for the question to Microsoft Community. I'll give my best to help you.

    1. what web browser do you use?
    2. don't you make changes to the computer before the show?
    3 when downloading files from Web site, that you get "do you want to run or save this file?"

    If you use Internet Explorer to download, I suggest you try the steps from the following link:

    Search for a file that you have downloaded
    http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-file-you-have-downloaded

  • On a Web site "contact us", unable to send an email. I have to configure POP3?

    I can't send email to a Web site page.  How do I configure this?

    Hello

    Yes, you do

    If you use Vista Windows Mail, follow these steps

    you need to configure your e-mail account windows mail with your ISP internet service provider

    They provide you with account settings you need to do

    Ask them to

    username
    password for your access broadband account / distance with them

    Server of incoming POP3 mail
    outgoing mail SMTP server

    and here's how to configure windows mail after getting the email correct account settings

    http://www.vista4beginners.com/Windows-Mail

  • In the body of the e-mail, Web sites, not to stress.

    Web sites do not highlight in the body of my emails. Example: http://en.wikipedia.org/wiki/Richard_Denning

    When you write a message, some publishers 'rich text' automatically detects and "linkify" one URL that you type or paste in, but others require you to use a button link, that usually appears on the formatting toolbar. Some link buttons you have first click on the button, type or paste the URL into a dialog box and click OK or Insertion, while others allow you to select a URL in your message and click the button once to convert. It really depends on this site that you use to create your messages.

  • Contact form of muse does not work with the e-mail address of the Yahoo customer. Any solution yet?

    The site of Muse is hosted on BC. My client has recently had a number of business cards printed with a yahoo email address, so I'm reluctant to suggest that he switch to a gmail account. I am aware of the policy of AOL/Yahoo DMARC. Any solution been found else that do not use yahoo/aol e-mail for the contact form?

    Thank you

    You can use a different email and then set up a rule before auto for @yahoo.com email in the contact notification email form field.

    It would be workaround for now.

    Thank you

    Sanjit

  • Muse contact form doesn't send emails.

    Muse site contact form doesn't send emails.  I make a form control using this link http:/my_site.com/scripts/form_check.php.  It gives the message this SQL configuration problem.

    Please help solve this problem.

    Hello

    Please contact your web hosting provider about the problem of server configuration. Describe the elements that are not marked in green in the form verification page, so that they can help you configure the servers to use the correct settings.

  • Malware attack of the script on the Web site

    Hello

    I'm a Web Designer and one of my sites was hacked recently, although the site is now clean I am concerned about malware that may have been installed on the PC of the user of the site with my own PC. The pirate has placed a script on the homepage which has opened a small iframe which connected to a website - I think THAT THIS WEBSITE IS DISTRIBUTING MALWARE OF SOME SORT so don't VISIT IT UNLESS YOU KNOW WHAT YOU're DOING - feedfaster (dot) com.

    I have not noticed any problems with my PC, but one of the users of the Web site contacted us because he was afraid. He told me he worked in internet security and that the site had installed a "backdoor" on his PC. He also said 'It was a very clever attack signature that is not captured by AVG, Sbybot or MalwareBytes' and only there because of what he was going to 'trash his PC. He told me that the script has been targeted to computers running windows and Internet Explore or firefox.

    I visited the site myself at the time the script was there and you click on ignore the warnings I got from my browser (as I tried to see what was going on on the site), so if there is a malware problem, I'm sure it will be on my PC. Today, I run the Microsoft Windows Malicious Software Removal Tool (Jan 2012) and also scan of Microsoft Security 1.0.3001.0 (which I downloaded today) and none of them found no problems. I also ran a scan complete wth AVG which found nothing either.

    Anyone would be able to tell me if these 2 tools of Microsoft detects the malware distributed by feedfaster if she was there and if not will be updated tools to detect in the near future?

    Any help or advice on this would be greatly appreciated.

    Mike

    Hi Mike,.

    If you think that your computer is still infected with a virus, try following the steps 1 and 2 in this virus/malware removal guide: http://www.selectrealsecurity.com/malware-removal-guide
    It contains instructions which will remove most malware infections. If you have any questions, just ask me. I hope this helps you.
    Brian
  • Any Web site I'll, will automatically switch to another Web browser when I click on a contact e-mail address link, even if firefox is my default?

    When I'm on a Web site, when I try to use the e-mail address provided in the contact section of the website whatever, I'm on, as soon as I click on the link to contact this person or persons, it will immediately move to Google Chrome, rather than continue to use Firefox, even though I have Firefox set as my default browser.

    Someone suggested that I go to my control panel and make sure that Firefox is selected, I went there to do this, set it as default and checked what it says under Chrome while I was there for. He said Chrome I have 1 default on 20. I went to see what it was. He has access to HTML, or whatever that one is (I can go back and get the full name if necessary) why would they automatically this default value assigned to them? I could not not - select this option for Chrome, it was not possible to for change, it is mandatory?

    Is this what can I do to configure Firefox for all the default settings?

    Check your setting mailto in Firefox.

    https://support.Mozilla.org/en-us/KB/change-program-used-open-email-links

  • can someone help me and show me how easily an e-mail website links to friends. How to import the address book (yahoo mail) personal information manager to send the links to the web sites of my contacts.

    can someone help me on how to e-mail easily links to websites with friends. also need to know how to import the address book for (yahoo mail) personal information manager to send links to the web sites of my contacts.

    Hi Claytoncharles,

    I suggest you follow the link provided below, which has the similar problem

    http://answers.Microsoft.com/en-us/IE/Forum/IE8-windows_other/trying-to-send-page-or-link-via-email-but-not/a8be4248-B803-41F6-9014-386301acb67e

    You can also view the article for more information:

    Import, export, or change the format for contacts

    http://Windows.Microsoft.com/en-us/Windows-Vista/import-export-or-change-the-format-for-contacts

  • When I click on a "contact" link in a web site to the e-mail of the Organization Firefox keeps opening more in addition to versions of himself in quick succession - lite

    The only way I can stop it is to completely turn off the computer, time that I have literally hundreds of pages of Firefox open. I use btinternet.com for e-mail. When you check the 'mailto' options in Firefox the only available is always 'ask '. Help, please!
    This occurs on a Web site with a link to e-mail.

    Hello

    Please see this.

  • Canadian web site uses my address book to send mail solicited on my behalf to my contacts.

    Has been held three times in as many weeks while signed offline and offline with MSN.  How a web site does not control your e-mail and address without permission.  What kind of security breach is the next, and what can do to prevent it happening again.  Performed the Safety Scanner and software security on the computer and found nothing.

    Hello

    Which is called Spoofing and its pretty easy for a spammer to make. Of course, it does
    it look like you or the other person has sent the e-mail. Someone intercepted an email and
    It may not be you who caused him. Account of a friend could have been consulted
    or even someone could have sent an email on your behalf to someone else who has been
    compromise. Your friend can access headers and block the real senders of
    those who will change often.

    How to read the message headers
    http://www.high-speed-Internet-Access-Guide.com/articles/email-headers.html

    E-mail spoofing
    http://en.Wikipedia.org/wiki/E-mail_spoofing

    E-mail spoofing and Phishing
    http://www.mailsbroadcast.com/email.broadcast.FAQ/46.email.spoofing.htm

    Understanding E-mail Spoofing
    http://www.windowsecurity.com/articles/email-spoofing.html

    Fraudulent emails (false)
    http://pages.eBay.com/education/spooftutorial/

    Google search - email Spoofing
    http://www.Google.com/search?hl=en&EI=FB1nS9DiNo7CsQPNhKGdAw&SA=X&Oi=spell&resnum=0&CT=result&CD=1&ved=0CAgQBSgA&q=email+spoofing&spell=1

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

Maybe you are looking for