Display a functional <a> link in an email?

102 views Asked by At

I'm trying to send e-mails through my J2EE app, with Apache Commons Email library. These mails must contain some links, so I developed an HTML template, but I'm facing an odd problem :

When my HTML template contains <a href="http://www.somelink.com">myLink</a>, the output URL looks like this : http://x9hy.mjt.lu/link/x9hy/vmpjsly/1/SEEMS-LIKE-A-VERY-LONG-HASH. When I click, I'm redirected to http://www.somelink.com, excepted on my boss' shitty mail client...

I tried to change the link to <a href="www.somelink.com">myLink</a> (without http://), then the URL looks fine. Excepted on Mac clients (Ipad, Macbook, Iphones), where www.somelink.com is prefixed by x-apple-msg-load://, and this breaks the link.

I tried to send a mail from PHPMailer from a PHP script, same issue...

I'm not sure to really understand where the problem comes from, and I'd like some help. Could it be a feature from my SMTP host ?

Thanks for the help.

1

There are 1 answers

0
Adrien Dos Reis On

Indeed, as SLaks said, it came from my SMTP server... I tried to switch and to use a dummy "smtp.gmail.com", and it worked fine... I'll try to understand how their redirect feature works.

Thanks.