电子邮件链接不适用于非 google 电子邮件客户端

Email links not working on non-google email clients

我一直在使用 Thymeleaf 构建 Web 应用程序,它的功能之一是在执行特定操作时向用户发送电子邮件。为了发送电子邮件,我一直在使用 gmail api,因为我无法访问自己的电子邮件服务器。到目前为止它一直工作正常,我发送的电子邮件确实到达了用户(在这种情况下为测试用户)但是已发送的电子邮件中的链接仅在收件人也使用 gmail 时才有效。我一直在努力寻找解决方案,但一直未能成功,我想知道问题出在哪里。

提前致谢!

代码

import email.MailSender;

MailSender sender = MailSenderProvider.getMailSender();

sender.sendMail(studentEmail,"Du har fått en ny handledare","Hej! "+name+ " <br>" + "Du har fått en ny handledare "+ " <br>"+
                        "logga in på: "+  "<a href='vfusocionom.hig.se'>" + "Vfusocionom.hig.se " + "</a>"+ "<br>"  +"för att se extra detaljer"  );

这是 Gmail 的最新保护措施,可防止电子邮件网络钓鱼攻击

Because links to malicious websites can be sent in emails, Google adds link protection for all official Gmail clients (web, Android, and iPhone & iPad). Some of these protections are now available for some users that use a third-party email application (IMAP client).

For these users, clicking a link in a recent message starts a malicious link check. If nothing malicious is detected, the user is taken to the destination. For older messages, a window might appear, requiring a tap or click to open the link.

来源: https://support.google.com/mail/answer/10173182?hl=en#zippy=%2Cwhich-third-party-email-applications-have-these-new-protections

我会建议客户端使用最新的电子邮件客户端或使用一些没有此保护的第三方 SMPT 服务器。请记住,随机使用第三方 SMTP 提供商可能存在风险。

我个人用过,sparkpost.com和mailgun.com。两者都非常好,并且有一些免费电子邮件的开发者计划。如果我没记错的话,sparkpost.com 也提供 SMTP 访问。