accents in e-mail

J

jim

Hi,

I can't gte accents in the subject and body fields of an e-mail !
This is my code :

document.location.href = 'mailto:[email protected]?subject=the subject is
éléphant&body=elephant is said éléphant in french !' ;

When the e-mail appears, I get weird characters instead of the wanted clean
accents.
Can you help me please ?

Thanks in advance,
 
J

jim

Hi,
I can't gte accents in the subject and body fields of an e-mail !
This is my code :

document.location.href = 'mailto:[email protected]?subject=the subject
is éléphant&body=elephant is said éléphant in french !' ;

When the e-mail appears, I get weird characters instead of the wanted
clean accents.
Can you help me please ?

Thanks in advance,

well... it works in IE, but not on firefox 1.5 neither opera 9.10
 
V

VK

jim said:
Hi,

I can't gte accents in the subject and body fields of an e-mail !

Because you have to escape the string values: either by yourself using
escape() method or let do it to a form.
This is my code :
document.location.href = 'mailto:[email protected]

Uhm... "Navigate browser to e-mail message"... Conceptual... but rather
crazy, is not it? ;-)

<html>
<head>
<title>1</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>

<body onload="
var frm = document.forms['email'];
frm.action = 'mailto:[email protected]';
frm.submit();

document.links[0].click();
">

<form name="email" action=""
<input type="hidden" name="subject" value="Always escape mailto data!"
<input type="hidden" name="body" value="й"
</form>
<p
href="mailto:[email protected]?subject=Always%20escape&body=%E9"
mailto</a></p>
</body>
</html>
 
J

jim

"VK" <[email protected]> a écrit dans le message de (e-mail address removed)...
Hi,

I can't gte accents in the subject and body fields of an e-mail !

Because you have to escape the string values: either by yourself using
escape() method or let do it to a form.
This is my code :
document.location.href = 'mailto:[email protected]

Uhm... "Navigate browser to e-mail message"... Conceptual... but rather
crazy, is not it? ;-)

<html>
<head>
<title>1</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>

<body onload="
var frm = document.forms['email'];
frm.action = 'mailto:[email protected]';
frm.submit();

document.links[0].click();
">

<form name="email" action=""
<input type="hidden" name="subject" value="Always escape mailto data!"
<input type="hidden" name="body" value="?"
</form>
<p
href="mailto:[email protected]?subject=Always%20escape&body=%E9"
mailto</a></p>
</body>
</html>


thank you for your solution.
the escape function is what I needed.
It works in IE and FF ...but not Opera !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top