I use phpmailer to send email with a hyperlink on its body. I have this code:
$body = "<a href='".DIR."activate.php?x=$id&y=$activasion'>".DIR."activate.php?x=$id&y=$activasion</a>"; require('classes/PHPMailerAutoload.php'); $mail = new PHPMailer; $mail->CharSet = "UTF-8"; $mail->SMTPDebug = 2; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = SMTP_HOST; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = SMTP_USER; // SMTP username $mail->Password = SMTP_PASSWORD; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 465; // TCP port to connect to $mail->setFrom(SMTP_USER); $mail->addAddress($to); // Add a recipient Name is optional $mail->isHTML(true); // Set email format to HTML $mail->Subject = $subject; $mail->Body = $body; $mail->AltBody = $altbody; if(!$mail->send()) { echo $mail->ErrorInfo; }
When I send an email to a Gmail address and open it in Gmail, the hyperlink looks fine (I can click the link and redirect to the page).
But when I send it to Outlook, the hyperlink looks like this:
[my.domain.com/activate.php?x=52&y=aa1fdf437c526ee219decc1ea72fc266] my.domain.com/activate.php?x=52&y=aa1fdf437c526ee219decc1ea72fc266
Any ideas on what might be wrong?
source share