Contact form won't send to email

I've done this contact form loads of times and it works fine but for some reason this particular form won't send to email. The php is good so it must be my form. I'll put both bits of code up anyway. Thanks
PHP:
<?php
if ($_POST){
if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){
$message="Please provide a correct email address";} else {
  $name = strip_tags($_POST['name']);
  $company_name = strip_tags($_POST['company_name']);
  $telephone = strip_tags($_POST['telephone']);
  $email = $_POST['email'];
  $comments = strip_tags($_POST['comments']);
  $to = '[email protected]';
  $subject = 'Contact form submitted.';
  $body = $name. "\n". $company_name. "\n". $telephone. "\n". $email. "\n" .$comments;
  $headers = 'From: ' .$email;
  if (mail($to, $subject, $body, $headers)) {
  echo 'Thanks for contacting us. We\'ll be in touch soon!';
  } else {
  $message = 'Sorry an error occurred. Please try again later.';
?>
<?php echo "<p style='color:red'>$message</p>"; ?>
HTML:
<form id="contactform" action="" method="post">
<p>Name:<br/><input name="name" type="text" required /></p>
<p>Company Name: <br/><input name="company_name" type="text" required/></p>
<p>Telephone: <br/><input name="telephone" type="tel" required/></p>
<p>Email: <br/><input name="email" type="email" required/></p>
<p>Comments: <br/><textarea name="comments" required/>   </textarea></p>
    <input type="submit" name="submit" value="Send!" formmethod="post"/>
</form>

PEAR is a library of useful functions that is often included in a PHP installation.
BUT. . .PHP only uses the mail capabilities of the server. If the server doesn't allow it, then you may not able to send email no matter what. . .however, I am not absolutely sure of that. I have never had to work with a server that did not support mail.
SMTP is a protocol that uses an email account to send mail. You may be able to tie your mail to an external SMTP account, for instance even a GMAIL account. PHPMailer is an add-on that you can use to do this. You can install it on your website. It isn't hard to use, but it is more involved than simply using PHP mail().
But really, have a conversation with the server admin about all of this. Find out why PHP mail isn't installed, and if he is willing to install it.

Similar Messages

  • Muse contact form is not sending emails.

    Muse site contact form is not sending emails.  I perform a form check using this link http:/my_site.com/scripts/form_check.php.  It is giving the message that SQL configuration problem.
    Please help to solve this.

    I posted a very similar issue into the bugs forum. "
    Email form submit not sending to GoDaddy and Yahoo hosted email accounts"
    I have tested the emails across various forms and it works but does not using the Muse form widget. I strongly believe this is an Adobe Muse issue and needs further support from Adobe. In the mean time I have begun using Jot Form on my sites (jotform.com)

  • I have a new email and am trying to change it in icloud. but it has locked me out and won't send my email a reset password link for some reason. even though it says its sent, it doesnt come to the email address

    i have a new email so have a new apple ID now and am trying to change it in icloud. but it has locked me out and won't send my email a reset password link for some reason. even though it says its sent, it doesnt come to the email address. help!

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact Apple ID Support, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    You will need to show patience with the procedure and be prepared to demonstrate without question that the account belongs to you. Don’t expect access to be restored immediately and if you aren’t the owner of the Apple ID registered to the device the account won’t be reset.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and/or tested on: 2014/12/18

  • HT1338 Why when trying to change my apple ID password apple won't send the email with the change instructions?

    Why when trying to change my apple ID password apple won't send the email with the change instructions?

    There is a contact link.
    Apple ID Support

  • Hi. I d like to email a photo from iPhoto but I keep receiving the same error message saying that the combination username /password is incorrect so it won't send the email. How do I reset these parameters so I can email my pix? Thx

    Hi. I d like to email a photo from iPhoto but I keep receiving the same error message saying that the combination username /password is incorrect so it won't send the email. How do I reset these parameters so I can email my pix? Thx

    You have a number of things that will make this not work.
    Your mailto link is not the way to go, take a look at this and it should get you on the right path.
    http://www.paulgdesigns.com/learncontactform.php
    On your action page, you can have it give the thank you message that you want.  Having a seperate page saying they forgot to do something complicates matters more than you might wish at this point, and usually irritates people. however if you decide you want to go that way, look up "sticky forms".  What this does is re-populate the fields when they have to go back to correct.
    A better way would be to validate the information, you can use Spry if you want which is built into dreamweaver.
    You also have in your html form this
    enctype="multipart/form-data"
    That is used for sending files, and since you are not, the form would not work, so you want to remove it.
    Hopefully that will give you a starting point.
    Gary

  • Offline interactive forms based on sending receiving emails in ABAP

    hello friends i am struck with a requirement of my client.
    I am new to Forms and WEBDYNPRO and I have to cover a scenario where I have to develop,'offline interactive forms based on sending receiving emails '..
    i browsed a bit and with all the luck found a very good resource.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cacb9a7d-0c01-0010-1281-be4962c9ab3e
    but the problem is it is in JAVA.. I dont know JAVA..I know ABAP..
    can any one give me similar tutorial in ABAP or any other related links ..
    waiting to give Big Reward Points...

    Hi,
    Go thru this [Article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9051b07e-0c01-0010-87bc-e3d527153a31].
    Regards,
    Padmam.

  • Sumbit form by email won't "send" from email

    The form that I am creating - using both Live Cycle as well as adding a "submit by email" button direct from Acrobat, pulls up the email message window when clicked - correctly showing recipient address and pdf form attached...problem is when I click "send" nothing happens. It's as if my email program (outlook 2003) crashes when trying to email form attachments. Please help & thank you ahead of time. ~Kate

    Do you have an anti Viris program running? Sometimes they are setup so that you cannot automate the sending of email.
    Paul

  • I am trying to change my security questions, and it won't send the email to my email.

    It says it sent it to the email i am using, and it sent out the password change, but im not recieving the security question email. HELP

    I am having the same issue, it just won't send the e-mail. The options that apple provides you are:
    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID
    Basically it tells you to go through the link to manage your ID and click on the link to send you the email (which we all did and clearly it's not workin)
    Then you can submit a form (which I did and was contacted but all they can manage to say is to call customer service as they are "not able to help" through e-mail. So the reply was to follow option 5, however I specified in the e-mail that I cannot call since I live in Costa Rica and cannot make international calls... THEY HAVE ME IN A LOOP I REALLY NEED TO GET OUT OF!!!!! If any one of you gets this issue fixed without calling, please let me know!

  • HT5312 What if it won't send an email if I forgot the questions?

    It won't let me send an email.

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, and filling out and submitting this form.
    (96739)

  • How do i create a group contact list inorder to send out emails to multiple persons?

    how do i create a contact list for emailing from my iphone4?

    I have created a free iphone application to send group emails, as you cannot do it natively.
    http://itunes.apple.com/fr/app/easy-group/id461469079?mt=8
    Rémi
    Note: I may receive some form of compensation, financial or otherwise,from my recommendation or link.

  • Contact Form won't display input text

    Hi,
    I'm trying to create a flash contact form that sends the
    user's message on enter key. Therefore I need you to help me do
    this and also help me understand why my form isn't displaying right
    when I have a mask for it.
    To get a better picture of the problem
    here you can
    see how the form should look like and
    here you can
    see the same form, but with the mask

    I'm not sure I understand what you mean by "embed the fonts
    in each of the text fields"
    Please have a look at the .fla file:
    http://www.claudiudesign.org/test/sterg.fla
    (this fla has the mask; if you remove it you will be able to
    see the working contact form)
    It won't take you more than 1 min to understand what's up
    with it if your good at this.
    Thing is I'm behind the schedule with this and I have to
    solve the problem as soon as possible.
    Thank You

  • Adobe Muse Contact Form is not sending messages

    Hi, I have a website live, created with Muse CC and hosted on Adobe Business Catalyst. The domain used is from GoDaddy. I have made a contact form and have linked 3 different emails to the form to receive inputed messages.  I have tried many times to send info using the contact form, testing to see if it would send to any of my emails. I have not been able to receive any messages so far and have even looked in the spam and junk folders on all 3 email accounts(yahoo, gmail, and outlook) and nothing has been received. Any help would be greatly appreciated.  I would like to use this site but cannot until this is fixed.

    Have you already contacted BC support for this issues, if yes then please provide me the ticket number , I will have a look.
    If not then please join live chat with BC support team.
    Thanks,
    Sanjit

  • My php contact form won't work. HELP!?

    I've been trying this for a while now, following a few different online tutorials. It seems like a simple concept but i just cannot get the contact form to relay any data. I'll paste my php coding and my form below. Any help would be much appreciated. Thanks.
    <div class="contact_form">
        <form id="contactform" action="contact.php" method="post">
      Name: <br><input name="name" type="text" id="name" value=""/>
        <br><br>
        Company Name: <br><input name="company_name" type="text" id="company_name" value=""/>
        <br><br>
        Telephone: <br><input name="telephone" type="tel" id="telephone" value=""/>
        <br><br>
        Email: <br><input name="email" type="email" id="email" value=""/>
        <br><br>
        Comments: <br><textarea name="comments" id="comments" value="" />  
        </textarea>
        <p></p>
        <input type="submit" name="submit" value="Send!"/>
    </form> 
    </div>
    <?php
    if (isset($_POST['name']) && isset ($_POST['company_name']) && isset ($_POST['telephone']) && isset ($_POST['email']) && isset ($_POST['coments']) ) {
      $name = $_POST['name'];
      $company_name = $_POST['company_name'];
      $telephone = $_POST['telephone'];
      $email = $_POST['email'];
      $comments = $_POST['comments'];
      if (!empty($name) && !empty($company_name) && !empty($telephone) && !empty($email) && !empty($comments) ) {
      $to = '[email protected]';
      $subject = 'Contact form submitted.';
      $body = $name. "\n" .$comments;
      $headers = 'From: ' .$email;
      if (@mail($to, $subject, $body, $headers)) {
      echo 'Thanks for contacting us. We\'ll be in touch soon!';
      } else {
      echo 'Sorry an error occurred. Please try again later.';
      } else {
      echo 'All fields are required.';
    ?>

    Try this:
    <!doctype html>
    <html>
    <?php
    if ($_POST){
    if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){
    $message="Please provide a correct email address";} else {
      $name = strip_tags($_POST['name']);
      $company_name = strip_tags($_POST['company_name']);
      $telephone = strip_tags($_POST['telephone']);
      $email = $_POST['email'];
      $comments = strip_tags($_POST['comments']);
      $to = '[email protected]';
      $subject = 'Contact form submitted.';
      $body = $name. "\n" .$comments;
      $headers = 'From: ' .$email;
      if (mail($to, $subject, $body, $headers)) {
      echo 'Thanks for contacting us. We\'ll be in touch soon!';
      } else {
      $message = 'Sorry an error occurred. Please try again later.';
    ?>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    </head>
    <body>
    <?php echo "<p style='color:red'>$message</p>"; ?>
    <div class="contact_form">
        <form id="contactform" action="contact.php" method="post">
    <p>Name:<br/><input name="name" type="text" required /></p>
    <p>Company Name: <br/><input name="company_name" type="text" required/></p>
    <p>Telephone: <br/><input name="telephone" type="tel" required/></p>
    <p>Email: <br/><input name="email" type="email" required/></p>
    <p>Comments: <br/><textarea name="comments" required/>   </textarea></p>
        <input type="submit" name="submit" value="Send!"/>
    </form>
    </div>
    </body>
    </html>

  • How do i reset my security questions if it won't send an email to alternate address

    how do i reset my security questions if it won't send to my alternate email address?

    If the email's not in the inbox or spam filter of your rescue email address, you need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (119008)

  • I'm having problems resetting my security questions it won't send the email

    So I'm having problems trying to reset my security questions it will not send the email that it says has been sent and the only way I can buy anything on iTunes is if I have the questions reset. I need severe help

    Forgotten Security Questions/Answers
    You need to contact Apple by:
    1 - Use the Express lane and start here:
    https://expresslane.apple.com
    then click More Products and Services>Apple ID>Other Apple ID Topics>Forgotten Apple ID security questions.
    or
    Apple - Support -form iTunes Store - Contact Us
    2 - Call Apple in your country by getting the number from here:
    http://support.apple.com/kb/HE57
    or           
    Apple ID: Contacting Apple for help with Apple ID account security
    3 - Use your rescue email address if you set one up
    Rescue email address and how to reset Apple ID security questions
    For general  information see:
    Apple ID: All about Apple ID security questions

Maybe you are looking for