我们的联系表格已经停止工作,我不确定问题是什么。我可以确认其他电子邮件工作正常。奇怪的是,一旦我点击提交,它就会返回给我http://mydomain.com/contact/index/
并且没有任何消息。另外, 如果测试消息看起来是垃圾邮件, Akismet将在 Akismet 部分捕获它。这是我的设置:
带表格的页面:
{{block type="core/template" name="contactForm" form_action="/contacts/index/post/" template="contacts/form.phtml"}}
form.html代码:
<form action="<?php echo $this->getFormAction();?>" id="contactForm" method="post">
<div class="fieldset">
<h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
<ul class="form-list">
<li class="fields">
<div class="field">
<label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
<div class="input-box">
<input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
</div>
</div>
<div class="field">
<label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
<div class="input-box">
<input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
</div>
</div>
</li>
<li>
<label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
<div class="input-box">
<input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
</div>
</li>
<li class="wide">
<label for="reason" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Reason') ?></label>
<div class="input-box">
<textarea name="reason" id="reason" title="<?php echo Mage::helper('contacts')->__('Reason') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
</div>
</li>
</ul>
</div>
<div class="buttons-set">
<p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
<input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
<button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
以下是 system.log 的内容:
2012-08-10T18:21:51+00:00 ERR (3): Notice: Undefined index: comment in /var/www/html/svn/magento/website/trunk/app/code/community/Centerax/Akismet/Model/Api.php on line 56
2012-08-10T18:21:51+00:00 ERR (3): Notice: Undefined index: comment in /var/www/html/svn/magento/website/trunk/app/code/community/Centerax/Akismet/controllers/Contacts/IndexController.php on line 52