I'm using PHP and SendGrid to send emails, within the content of the email there are some links but gmail removes the href from all of them, this does not happen with other providers such as iCloud.
For expmaple, the result of:
<a href="https://espn.com" target="_blank" rel="noopener">ESPN</a>
Is:
<a rel="noopener">ESPN</a>
Even the target is removed sometimes
My domain is already verified in the mail provider (SendGrid), what I can do?
Code:
$email = new \SendGrid\Mail\Mail();
$email->setFrom("myemail@icloud.com", "Header text");
$email->setSubject('Subject');
$email->addTo("customer@gmail.com", 'Customer name');
$email->addContent(
"text/html", '<a href="https://espn.com" target="_blank" rel="noopener">ESPN</a>'
);
$sendgrid = new \SendGrid('theToken');
try {
$response = $sendgrid->send($email);
/* print $response->statusCode() . "\n";
print_r($response->headers());
print $response->body() . "\n"; */
} catch (Exception $e) {
/* echo 'Caught exception: '. $e->getMessage() ."\n"; */
}
As can you see, the problem is only in gmail