Mail delivery issues

Source: Internet
Author: User
Mailbox URL Phpmailer

I write the content in the background, and then sent to the mailbox, the content contains a click link to the site of the link, but sent to the mailbox href= "XXX" will not have, as I wrote: $url = "www.baidu.com";
$emailContent = "Test";
But to the mailbox can not click on the link, turned into a test, ask you Daniel This is what is going on


Reply to discussion (solution)

Post Code for analysis

$url = "www.baidu.com";
$emailContent = "Test";
SendMail ($toEmail, ' Change Password confirmation email ', $emailContent);


function SendMail ($address, $title, $message)
{
Require ("thinkphp/extend/vendor/phpmailer_v5.1/class.phpmailer.php");

$mail =new Phpmailer ();
Set Phpmailer to send email using an SMTP server
$mail->issmtp ();

Set the character encoding of the message, or ' UTF-8 ' if not specified
$mail->charset= ' UTF-8 ';

Add a recipient address that can be used multiple times to add multiple recipients
$mail->addaddress ($address);

Set the message body
$mail->body= $message;

Sets the From field of the message header.
$mail->from=c (' mail_address ');

Set Sender Name
$mail->fromname=c (' Mail_sender ');
Set the message header
$mail->subject= $title;

Set up the SMTP server.
$mail->host=c (' mail_smtp ');

Set to "Require verification"
$mail->smtpauth=true;

Set the user name and password.
$mail->username=c (' mail_loginname ');
$mail->password=c (' Mail_password ');

$mail->ishtml (TRUE); Whether HTML mail is supported

Send the message.
Return ($mail->send ());
}

$url = "www.baidu.com";
$emailContent = "Test";
This paragraph was not resolved successfully.

$emailContent =<<
Test
TXT;

Do not understand, followed by your code to write, or not, in the mail received or test

It's possible that the email content is filtered.

Phpmail seems to have a parameter setting, whether to filter HTML

$url = "www.baidu.com";
$emailContent = "Test";
This paragraph was not resolved successfully.

$emailContent =<<
Test
TXT;

$emailContent =<<
Test
TXT;
Echo $emailContent;

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.