**指使用下面给出的邮件将发送垃圾邮件。我没有使用
在我想要的形式的验证码。所以任何人都可以帮助我 邮件收件箱**
<?php
if(isset($_POST['submit']))
{
$name = $_POST['Name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$date = $_POST['checkinDate'];
$package = $_POST['package'];
$person = $_POST['adults'];
$kids = $_POST['kids'];
$ip=$_SERVER['REMOTE_ADDR']; //trace the ip address of the user submited
$subject ="Query From :Kerala-Honeymoon-Packages - Promotion\n"; //subject of the email
$to="paul@roverholidays.com";
$cc="online@roverholidays.com";
$ccc="deepti@roverholidays.com";
$from=$_POST['email'];
$adc="Name :$name\n";
$adc.="Email :$email\n";
$adc.="Phone :$phone\n";
$adc.="Date of Travel :$date\n";
$adc.="Package :$package\n";
$adc.="Adults :$person\n";
$adc.="Kids :$kids\n";
$message ="$name copy of the query you submited in Kerala-Honeymoon-Packages";//message header to user submited
$headers="From: <".$from. ">" ;
mail($cc,$subject,$adc,$headers);
mail($ccc,$subject,$adc,$headers);
mail($email,$message,$adc);
header("Location: thanks.htm");
}
else
{
return false;
}
?>
答案 0 :(得分:0)
编码方式我不认为您可以做任何事情,因为电子邮件服务器会将您的电子邮件归类为垃圾邮件,而不是您编写脚本的方式。您所能做的就是从接收方电子邮件设置中控制它,即您设置gmail过滤器以检测基于关键字的电子邮件,例如&#34; Kerala-Honeymoon-Packages&#34;并将其从垃圾邮件中移除。
我不确定电子邮件服务器算法将电子邮件标记为垃圾邮件的原因。但是,我认为从不同的域而不是您的域名发送电子邮件可能会被检测为网络钓鱼电子邮件。我的意思是当有人将他/她的雅虎电子邮件放在表单中并点击发送时,您的服务器会将电子邮件发送到脚本中的电子邮件地址,但它会发送它,好像它来自雅虎,这将是可疑的收件人电子邮件服务器,因为它知道它不是来自雅虎。
答案 1 :(得分:0)
许多电子邮件服务会阻止直接从随机服务器发送的邮件,因为它们作为非垃圾邮件的合法来源几乎没有声誉。请尝试使用Mandrill或Gmail的SMTP服务等SMTP服务,而不是使用直接的php mail()
功能。两者都是免费的。
以下是Mandrill的配置页面: http://help.mandrill.com/entries/23737696-How-do-I-send-with-PHPMailer-
<?php
require 'class.phpmailer.php';
$mail = new PHPMailer;
$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.mandrillapp.com'; // Specify main and backup server
$mail->Port = 587; // Set the SMTP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'MANDRILL_USERNAME'; // SMTP username
$mail->Password = 'MANDRILL_APIKEY'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mail->From = 'from@example.com';
$mail->FromName = 'Your From name';
$mail->AddAddress('josh@example.net', 'Josh Adams'); // Add a recipient
$mail->AddAddress('ellen@example.com'); // Name is optional
$mail->IsHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <strong>in bold!</strong>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->Send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';