/    Sign up×
Community /Pin to ProfileBookmark

Email Link validation error

Hi,

I have an email link where I have added the &CC &BCC and & Body instructions as follows:

<a href=”mailto:[email protected]?Subject=Email Test&CC=&BCC=&Body=This is an email test”>email</a>

However this does not validate with the additions.(It validates ok as far as the subject field but throws up errors after this.) Am I doing something wrong or is this just not allowed? Or maybe there’s a workaround?

Any help appreciated.

Paul

to post a comment
HTML

10 Comments(s)

Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 15.2002 — Hi Dave,

Thanks for your reply, but I think I've managed to get it to validate.

I've replaced the & symbol with & a m p ; so the line now looks like this:

<a href="mailto:[email protected]?Subject=Email Test& a m p ; cc=& a m p ;bcc=& a m p ; body=This is an email test">email</a>

(note there are no spaces between & a m p ; it's just that this message board interprets them as & only)

It now validates ok and seems to work ok but I haven't done a thorough check yet.

Thanks.

Paul
Copy linkTweet thisAlerts:
@StefanDec 15.2002 — Try this

<a href="mailto:[email protected]?Subject=Email%20Test&amp;amp;CC=&amp;amp;BCC=&amp;amp;Body=This%20is%20an%20email%20test">hepp</a>
Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 15.2002 — Thanks Stefan,

Your version also validates thanks. It also validates with spaces in the text instead of the percent20 OK.

However, on testing I note that if I use the percent20 instead of a space, the percent20 gets printed in the body of the email as part of the message. If I just use spaces it's ok in IE and Mozilla but Opera prints percent20 whichever version I use!

Perhaps its best to leave the body message out altogether?

Thanks

Paul
Copy linkTweet thisAlerts:
@CharlesDec 15.2002 — [font=georgia]Here's what's going on. The validator checkes for two types of wrong&eacute;dness. It checks to see if you've folowed the general rules of SGML or XML as appropriate. In XML this is called 'well formedness' and involves dropping or mistyping closing tags and omitting quotes around attribute values and such. It also checks for conformity to the Document Type Definition (DTD) specified in the Document Type Declaration (DOCTYPE). This is called 'validity'. According to the 4.01 DTD the HREF attribute, unsuprisingly, takes a URI (http://www.w3.org/TR/html4/sgml/dtd.html#Shape). And a URI is defined as CDATA (http://www.w3.org/TR/html4/sgml/dtd.html#URI) and CDATA gets processed for entitieas and other things. (http://www.w3.org/TR/html4/types.html#type-cdata). In a DTD there is no way to describe the types of restrictions that are imposed on URI's in the world, so the validator doesn't check for them. (In the future we'll be giving up on DTDs in favour of schemae, which do allow for the imposition of more narrow requirements.) So, it is perfectly valid to have white space in your URI, even though it's an error. But it's an error that really doesn't matter because your attribute value isn't really a URI, it's just prenting to be one - just like the bad habit of using JavaScript as the HREF value.[/font].
Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 15.2002 — Hi Charles,

Thanks for the thorough explanation.

Much appreciated.

Paul
Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 15.2002 — Hi Dave,

I did wonder how it was achieved ?

It's easy when you know how.

Thanks

Paul
Copy linkTweet thisAlerts:
@StefanDec 16.2002 — [i]Originally posted by Paul O'B [/i]

[B]

However, on testing I note that if I use the percent20 instead of a space, the percent20 gets printed in the body of the email as part of the message.
[/QUOTE]




Um %20 shows up as spaces in my e-mail client. I use Mozilla mail.



What did you test with?
Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 16.2002 — Hi Stefan,

I use Incredimail.

I can confirm that mozilla mail works correctly and I have now checked Outlook Express and that seems ok as well.

However Office Outlook displays spaces ok but inserts the &BCC= in to the CC field!

I think for the sake of compatability I will just use the normal email link.

Thanks to everyone for their advice.

Paul
Copy linkTweet thisAlerts:
@StefanDec 16.2002 — [i]Originally posted by Paul O'B [/i]

[B]

I think for the sake of compatability I will just use the normal email link.

[/B]
[/QUOTE]


That might be a good idea, but I would still make bugreports for the software that doesn't get it right. If noone does, when will it even get fixed? ?
Copy linkTweet thisAlerts:
@Paul_O_BauthorDec 16.2002 — That's a good point Stefan. I'll do it now and thanks again for your help.

Paul
×

Success!

Help @Paul_O_B 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.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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