Home > Mobile >  Email links not working on non-google email clients
Email links not working on non-google email clients

Time:12-03

I've been building a web application using Thymeleaf, one of its function is sending an email to users if a certain action has been performed. To send the emails I've been using the gmail api as I don't have access to an email server of my own. It's been working fine so far, the emails I send do arrive to the users(test users in this case) however the links in the emails that have been sent only work if the recipient is also using gmail. I've been trying find a solution but haven't managed to get it work and was wondering what the problem might be.

Thanks in advance!

Code

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"  );

The email in question

CodePudding user response:

This is a recent protection from Gmail to prevent email phishing attacks

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.

Source: https://support.google.com/mail/answer/10173182?hl=en#zippy=,which-third-party-email-applications-have-these-new-protections

I would recommend client to use latest email client or use some third-party SMPT servers that does not have this protection. Remember, using random third-party SMTP providers might be risky.

I have personally used, sparkpost.com and mailgun.com. Both were pretty good and had some developer plans for free emails. If I remember correctly, sparkpost.com provides SMTP access too.

  • Related