/    Sign up×
Community /Pin to ProfileBookmark

execCommand to email: links are wrong

Hello,

I created a html newsletter editor with execCommand.
Basicly, my client can markup his newsletter in an iframe set to contenteditable, then send out the newsletter with ajax/php.

This works without any problems save one:
Any links inside the body of the newsletter that are created with execCommand(‘createlink’, false, url) come out wrong in Outlook and Hotmail (yet to test it in Thunderbird and/or GMail).

In Outlook, there are slashes added to the url, which cause it to display an “Incorrect url” error:
For example i create a link [URL]http://www.blabla.com[/URL] in the newsletter and send it out, on mouseover the link within Outlook, the statusbar displays [URL]“http://www.blabla.com”[/URL] as the url, clicking results in a browserwindow with [URL]res://ieframe.dll/syntax.htm#”http://www.blabla.com/“[/URL] in the adresbar.

In Hotmail, the url seems to be totally blocked and unclickable.

These problems only occur inside the emailclients. I have a link send with the newsletter to an online version, where the links work fine.

Links that aren’t created by execCommand (such as the links to the online version, unsubscribe page etc.) do not have these problems.

Any suggestions are more then welcome.
Thanks in advance

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @MarcD spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...