Я использую PHPMailer для отправки электронной почты.
$mail = new PHPMailer();
$mail->SMTPAuth= true;
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.live.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "data.edi@outlook.com"; // SMTP username
$mail->Password = "*******"; // SMTP password
$mail->From = "data.edi@outlook.com";
$mail->FromName = "Office";
$mail->addAddress($getEmailAddress);
$mail->IsHTML(true);
$mail->Subject = "SIIX Email Renewal verification";
$mail->Body = "
<div style='line-height: 20px;'>
Dear All Outlook email user,<br><br>
To complete the outlook email renewal this year we need to verify whether this email received successfully or not.<br>
Please kindly help to verify by open the link below to confirm it.<br><br>
<a href='//1.1.1.1:8082/renewal/mail/verify.php?email=$getEmailAddress' style='font-size: 20px; color: #0055a7; font-weight: bold;'>
<img src='http://1.1.1.1:8082/renewal/mail/outlook.png'/><br>
<u>Verify Now</u></a><br><br>
Thank you<br>
Outlook Exchange Mail Administrator<br>
<img src='http://1.1.1.1:8082/renewal/mail/office.jpg'/>
</div>
";
$mail->Send();
Когда я пытаюсь запустить код, при получении электронной почты я не могу нажать Verify Now
на мобильном телефоне.
<a href='//1.1.1.1:8082/renewal/mail/verify.php?email=$getEmailAddress' style='font-size: 20px; color: #0055a7; font-weight: bold;'>
<img src='http://1.1.1.1:8082/renewal/mail/outlook.png'/><br>
<u>Verify Now</u></a>
Затем я пытаюсь изменить его на (добавьте http:)
<a href='http://1.1.1.1:8082/renewal/mail/verify.php?email=$getEmailAddress' style='font-size: 20px; color: #0055a7; font-weight: bold;'>
<img src='http://1.1.1.1:8082/renewal/mail/outlook.png'/><br>
<u>Verify Now</u></a>
При попытке запустить код я не вижу ни одного полученного письма.
Затем я пытаюсьизмените его снова (Добавить \
):
<a href=\'http://1.1.1.1:8082/renewal/mail/verify.php?email=$getEmailAddress\' style='font-size: 20px; color: #0055a7; font-weight: bold;'>
<img src='http://1.1.1.1:8082/renewal/mail/outlook.png'/><br>
<u>Verify Now</u></a>
Затем я пытаюсь запустить код еще раз и получаю результат ссылки:
http://\http://1.1.1.1:8082/renewal/mail/verify.php?email=david.alwis@siix.com.sg\
Как это исправить?
Обновление
Журнал:
SMTP -> FROM SERVER:220 SG2PR04CA0156.outlook.office365.com Microsoft ESMTP
MAIL Service ready at Wed, 16 May 2018 09:09:58 +0000
SMTP -> FROM SERVER: 250-SG2PR04CA0156.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready
SMTP -> FROM SERVER: 250-SG2PR04CA0156.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:250 2.1.0 Sender OK
SMTP -> FROM SERVER:250 2.1.5 Recipient OK
SMTP -> FROM SERVER:354 Start mail input; end with .
SMTP -> FROM SERVER:250 2.0.0 OK [Hostname=SG2PR06MB2122.apcprd06.prod.outlook.com]
SMTP -> FROM SERVER:220 SG2PR04CA0152.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 16 May 2018 09:09:59 +0000
SMTP -> FROM SERVER: 250-SG2PR04CA0152.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready
SMTP -> FROM SERVER: 250-SG2PR04CA0152.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:250 2.1.0 Sender OK
SMTP -> FROM SERVER:250 2.1.5 Recipient OK
SMTP -> FROM SERVER:354 Start mail input; end with .
SMTP -> FROM SERVER:250 2.0.0 OK [Hostname=SG2PR06MB2122.apcprd06.prod.outlook.com]
SMTP -> FROM SERVER:220 SG2PR04CA0167.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 16 May 2018 09:10:00 +0000
SMTP -> FROM SERVER: 250-SG2PR04CA0167.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready
SMTP -> FROM SERVER: 250-SG2PR04CA0167.outlook.office365.com Hello [175.111.116.70] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:250 2.1.0 Sender OK
SMTP -> FROM SERVER:250 2.1.5 Recipient OK
SMTP -> FROM SERVER:354 Start mail input; end with .
SMTP -> FROM SERVER:250 2.0.0 OK [Hostname=SG2PR06MB2122.apcprd06.prod.outlook.com]