某些联系人由于主机上的垃圾邮件过滤而导致未发送电子邮件 [英] Some contact form emails not being sent due to spam filtering on host

查看:298
本文介绍了某些联系人由于主机上的垃圾邮件过滤而导致未发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的网站上的联系表格进行调整。这是一个PHP / Ajax联系表单。

I need my contact form on my website to be adjusted. It's a PHP/Ajax Contact Form.

目前我有一个问题 - 当客户填写我的联系表格NAME - EMAIL - SUBJECT - MESSAGE有一个问题,我的DREAMHOST服务器由于他们的新的反垃圾邮件政策,我不会收到一些消息 - 如果他们的电子邮件是@ hotmail.com没事。但是如果他们的电子邮件是@ gmail.com,我不会收到消息等。

Currently i have a problem - When a client fills out my contact form NAME - EMAIL - SUBJECT - MESSAGE there is an issue with my DREAMHOST Server due to their new anti spam policy and i dont receive some messages - If their email is @hotmail.com that's fine. But if their email is @gmail.com i dont get the message etc.

DREAMHOST TELLS ME:

DREAMHOST TELLS ME:


感谢您联系技术支持我检查了您的网站上的表单的日志,并确实看到邮件被服务器退回,由于最近实施的反垃圾邮件政策,不允许电子邮件从服务器使用非Dreamhost传出服务器或发送电子邮件地址。您可以在这里阅读有关此政策的更多详情:

Thanks for contacting Tech Support I checked the logs for the form on your site and did see that the emails are being bounced by the server due to recently implemented anti spam policies which won't allow email sent from the server using non-Dreamhost outgoing servers or "send from" email addresses. You can read more details on this policy here:

http: //wiki.dreamhost.com/Sender_Domain_Policy_and_Spoofing

您的邮件表单将访问者的电子邮件地址用作From地址,在大多数情况下,该地址不是Dreamhost托管电子邮件地址由于上述垃圾邮件策略,如果电子邮件地址不使用Dreamhost邮件服务器,服务器将阻止从服务器发送的邮件。所以你需要做的是将邮件表单设置为使用您的Dreamhost托管地址作为发件人地址。

Your mail form uses the visitor's email address as the 'From' address which in most cases is not a Dreamhost hosted email address. Due to the spam policy above, the server will block mail being sent off the server if the email addresses are not using Dreamhost mail servers. So what you will need to do is either set the mail form to use your Dreamhost hosted address as the 'From' address.

或者您将需要找到另一个邮件表单这将允许您将固定的电子邮件地址设置为发件人地址。这样,您可以将Dreamhost托管的电子邮件地址设置为From地址。

Or you will need to find another mail form that will allow you to set a fixed email address as the 'From' address. This way you can set a Dreamhost hosted email address in the form as the 'From' address.

以下代码: p>

THE CODE AS FOLLOWS:

<?php
/*
Credits: Bit Repository
URL: http://www.bitrepository.com/
*/

include dirname(dirname(__FILE__)).'/config.php';

error_reporting (E_ALL ^ E_NOTICE);

$post = (!empty($_POST)) ? true : false;

if($post)
{
include 'functions.php';

$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);


$error = '';

// Check name

if(!$name)
{
$error .= 'Please enter your name.<br />';
}

// Check email

if(!$email)
{
$error .= 'Please enter an e-mail address.<br />';
}

if($email && !ValidateEmail($email))
{
$error .= 'Please enter a valid e-mail address.<br />';
}

// Check message (length)

if(!$message || strlen($message) < 15)
{
$error .= "Please enter your message. It should have at least 15 characters.<br />";
}


if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $message,
     "From: ".$name." <".$email.">\r\n"
    ."Reply-To: ".$email."\r\n"
    ."X-Mailer: PHP/" . phpversion());


if($mail)
{
echo 'OK';
}

}
else
{
echo '<div class="notification_error">'.$error.'</div>';
}

}
?>

所有我需要知道的是我需要做的代码,所以我可以收到所有提交的我的联系表。

All i need to know is what i need to do to the code so i can receive all submissions of my contact form. I would really be grateful if someone could help.

推荐答案

替换以下内容:

mail = mail(WEBMASTER_EMAIL, $subject, $message,
 "From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"

只需:

$mail = mail(WEBMASTER_EMAIL, $subject, $message,"X-Mailer: PHP/" . phpversion());

并将用户的电子邮件地址添加到您的邮件中if你需要的是,现在你正在做的是 欺骗 ,即使是善意的,你基本上是犯欺诈,这相当于有人打电话给你对您的产品感兴趣,您将其物理地址放在信封的左上角,然后发送一封信,表示来电者感兴趣,除此之外,只是一个相当奇怪的做事的方式,它也建议一个电子纸痕迹,建议用户实际上通过电子邮件发送给你,他们没有。我个人觉得不舒服,发现我的电子邮件地址在填写一个在线表单后就这样使用了。

and add the user's email address to your message if you need to. What you are doing right now is called spoofing and even when well-intentioned, you are essentially committing fraud. It would be the equivalent of someone calling you to show interest in your product and you taking down their physical address and putting that in the upper-left corner of an envelope and then sending yourself a letter saying that the caller is interested. In addition to this just being a fairly-odd way of doing things, it also suggests an electronic paper trail that suggests the user actually emailed you, which they did not. I personally would be uncomfortable finding out my email address was used in this way after filling out an online form.

这篇关于某些联系人由于主机上的垃圾邮件过滤而导致未发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆