PHP form not showing in recipient's mailbox

My form is not being sent to the recipient on submission! I modified the mail.tpl.txt file to send my own email as a test and I got the email just fine.

The client has also checked the junk mail folder and he just isn't getting the information.

Below is the form code, then the code from mail.tpl.txt and then the index.php form code.

Everything looks good to me, so I ask if anyone has any idea why it won't get in shape. He uses qwest for email if that helps anyone.

Here's the form code:

<form id="contactForm" name="form" action="form/index.php" method="post">
  <fieldset>
  <legend><font color="#000000"><strong>Please fill out the form below if you have any questions.</strong></font></legend>
    <div>
    <label for="name">Name:* </label>
    <input type="text" size="30" name="name" class="txt" id="name" />
  </div>
    <div>
    <label for="label">Phone: </label>
    <input type="text" size="30" name="phone" class="txt" id="label" />
  </div>
    <div>
    <label for="email">Email:* </label>
    <input type="text" size="30" name="email" class="txt" id="email" />
  </div>
    <div>
    <label for="message">Message: </label>
    <textarea rows="6" name="message" id="message" cols="40" class="txt"></textarea>
  </div>
    <input type="hidden" name="thanks" value="../thanks.php" />
  <input type="hidden" name="email_fields" value="email" />
  <input type="hidden" name="required_fields" value="name, email" />
  <input type="hidden" name="html_template" value="form.tpl.html" />
  <input type="hidden" name="mail_template" value="mail.tpl.txt" />
  <div class="submit">
    <input type="submit" class="btn" value="Send Message" name="Submit" id="Submit" />
  </div>
  </fieldset>
</form>

      

Now the mail.tpl.text code is: (I took out my full client address and domain name for the post.)

    To: "xxxxxxx Custom Homes" <xxxxxxx@q.com>
    From: "{name}" {phone} <{email}> <{message}>
    MIME-Version: 1.0
    Content-type: text/plain; charset={txt_charset}
    Subject: Online Contact Request from Freese Custom Homes

    Contact Information:
    {name} {phone}
    Email Address: {email}

    Contact Message:
    {message}

Lastly, here the form index.php code: (Again, I have taken out my client domain name for the post)

<?php

          $script_root           = './';

          $referring_server      = ''; // Example: $referring_server = 'xxxxxxx.com, www.xxxxxxx.com';

          $language              = 'en';      // (see folder 'languages')

          $ip_banlist            = '';

          $ip_address_count      = '0';
          $ip_address_duration   = '48';

          $show_limit_errors     = 'yes';    // (yes, no)

          $log_messages          = 'no';     // (yes, no) -- make folder "temp" writable with: chmod 777 temp

          $text_wrap             = '72';

          $show_error_messages   = 'yes';

          $attachment            = 'no';    // (yes, no) -- make folder "temp" writable with: chmod 777 temp
          $attachment_files      = 'jpg, gif,png, zip, txt, pdf, doc, ppt, tif, bmp, mdb, xls, txt';
          $attachment_size       =  9000000;

          $captcha               = 'no';   // (yes, no) -- make folder "temp" writable with: chmod 777 temp

          $path['logfile']       = $script_root . 'logfile/logfile.txt';
          $path['templates']     = $script_root . 'templates/';

          $file['default_html']  = 'form.tpl.html';
          $file['default_mail']  = 'mail.tpl.txt';

  /*****************************************************
  ** Add further words, text, variables and stuff
  ** that you want to appear in the templates here.
  ** The values are displayed in the HTML output and
  ** the e-mail.
  *****************************************************/
          $add_text = array(
                              'txt_additional' => 'Additional', //  {txt_additional}
                              'txt_more'       => 'More'        //  {txt_more}

                            );

  /*****************************************************
  ** Do not edit below this line - Ende der Einstellungen
  *****************************************************/

  /*****************************************************
  ** Send safety signal to included files
  *****************************************************/
          define('IN_SCRIPT', 'true');

  /*****************************************************
  ** Load formmail script code
  *****************************************************/
          include($script_root . 'inc/formmail.inc.php');

          echo $f6l_output;

?>

      

-2


source to share


3 answers


You are now sending plain text - you must correct the content type of this email header.

Just set it to text / html. There may be more information here:



Or google for this, there are many sources!

+2


source


To add the relevant headers see:
http://nl2.php.net/manual/en/function.mail.php
example 4.
This btw is just Sebastian aswer with a link.



+1


source


The From header line is invalid. Text outside the quotes:

From: "{name}" {phone} <{email}> <{message}> 

      

And what does <{message}> do there. The only correct format is:

From: "{name} {phone}" <{email}>

      

You cannot use a post placeholder there because it contains newlines and this will destroy the post header.

+1


source







All Articles