Reputation: 1702
I am sending out HTML emails via Amazon SES.
Here's an example email -
Hey John doe,
Uncle Sam has just applied for the job need someone to post on craigs list.com you posted on JobHouse.
Cheers.
Now, Gmail (and maybe other email clients) add a hyperlink to the list.com
. How can this be prevented?
Upvotes: 0
Views: 769
Reputation: 211
Server-side solution:
Surround all dots (".") and at-signs ("@") with Zero-Width Space characters.
Example (PHP):
$email = '[email protected]';
$email = str_replace (
array('@', '.'),
array('​@​', '​.​'),
$email
);
Alternatively, you may use a Unit-Separator (
) or a Record-Separator (
), instead of the zero-width space character (​
) above.
Visually, the email / website address will seem normal, as before the replacements.
Note: replacing dots & at-signs with their html codes (.
& @
respectively) does not solve the problem. Gmail's algorithm still interprets string as an address.
Upvotes: 1
Reputation: 5348
In theory you could use <text>yoururl.com</text>
in your email generation.
Though I'm not 100% on if it'll work in GMail as I have nothing to test with to hand currently.
Upvotes: 0
Reputation: 4879
From my understanding when you are sending out the email, if you are not creating the hyperlinks in your HTML content then you have no control over how the client renders the content. If someone views the email with Gmail, Outlook, Mail, etc. and they notice a "pattern" they determine as a URL, the client application will replace the values.
SEE: http://php.net/manual/en/function.imagettftext.php
You could create a simple PHP script for example and pass in the web address as URL parameters and it returns an image with that URL. You then change your HTML code and instead:
<img src="domain.com/path/to/your/text.php?text=craigslist.com" />
Aside from doing something like this, there is no way you can control how the client application will render your text.
Upvotes: 0