简体   繁体   English

在PHP中使用链接和参数发送邮件

[英]sending mail with link and parameter in PHP

I have a strange issue with sending a mail with php, here is my code: 我用php发送邮件时遇到一个奇怪的问题,这是我的代码:

$link = "http://www.somelink/verify.php?id=".$uniqID;

$message ="<html><head></head><body><p>Full Name:".$data[0]." ".$data[1]."</p>";
$message .="<p>Flight Number: ".$data[4]."</p>";
$message .="<p>The Ride: ".$curPlace." to ".$data[5]."</p>";
$message .="<p>Number of Passengers: ".$data[3]."</p>";
$message .="<p>Date:".$data[6]." time:".$data[7]."</p>";
$message .="<p>The price: ".$data[8]."</p>";
$message .="<p>To verify the reservation press this <a href=".$link.">link</a></p></body></html>";

$headers = 'From: my@email.com' . "\r\n" .'Reply-To: some@email.com';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "Sensitivity: Personal"."\r\n";
$sent=mail($data[2],"Taxi Reservation",$message, $headers);
if($sent){
    echo "Message was sent to ".$data[2];
}
else{
    echo "Message was not sent";
}

The problem is with Gmail.If I send it as is, I get the success message, but get nothing in my gmail, but do get in another not gmail account. 问题出在Gmail上。如果我按原样发送,我会收到成功消息,但我的gmail中什么也没收到,但确实得到了另一个非gmail帐户。 BUT! 但! If I delete a tag from this line: $message .="<p>To verify the reservation press this <a href=".$link.">link</a></p></body></html>"; 如果我从以下行删除标签: $message .="<p>To verify the reservation press this <a href=".$link.">link</a></p></body></html>"; I do get the message in Gmail.So I can't understand what's the problem. 我确实在Gmail中收到了邮件。所以我不明白是什么问题。 What can couse this problem? 有什么可以解决这个问题? Thank you for your help. 谢谢您的帮助。

If your email is not arriving at Gmail, but the same code sending the same email is arriving at a different account, I suspect that the problem is that Gmail are seeing your email and classifying it as spam - have you checked to see if it's gone into your spam folder instead of your inbox? 如果您的电子邮件没有到达Gmail,但是发送相同电子邮件的相同代码到达了另一个帐户,则我怀疑问题是Gmail正在查看您的电子邮件并将其分类为垃圾邮件-您是否检查过邮件是否已消失进入垃圾邮件文件夹而不是收件箱?

Gmail has a set of rules to identify what they think is spam - presumably, including the link is enough to push your email into the spam category. Gmail有一套规则来识别他们认为的垃圾邮件-大概包括该链接足以将您的电子邮件推入垃圾邮件类别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM