2008-11-20 51 views
-2

我的表單在提交時沒有發送給收件人!我將文件mail.tpl.txt更改爲直接發送到我自己的電子郵件地址作爲測試,並且我收到了電子郵件。PHP表單沒有顯示在收件人的郵箱中

客戶端也檢查了垃圾郵件文件夾,他只是沒有獲取信息。

以下是表單代碼,其後是來自mail.tpl.txt的代碼,然後是表單的index.php代碼。

一切看起來都對我好,所以我問是否有人有任何想法,爲什麼他不會得到的形式。如果有幫助,他使用qwest發送電子郵件。

這裏的表單代碼:

<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> 

現在mail.tpl.text代碼:(我已經採取了我的客戶的詳細地址和域名後)

To: "xxxxxxx Custom Homes" <[email protected]> 
    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's the form's index.php code: (Again, I have taken out my client's 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; 

?> 
+0

'是'和'否'而不是TRUE或FALSE? – alex 2009-07-03 01:38:59

回答

1

From標題行不正確。有文字引號外:

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

又有什麼< {文}>做什麼。唯一正確的格式是:

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

不能使用該消息佔位符存在,因爲它包含了新的生產線,這將打破郵件標題。

相關問題