Forum Moderators: open
function emailVForm(){
var subject = "Order Form";
var body_message = "Hi, "+name+"%0D%0DPlease find attached pdf proofs for your order.%0D%0D Bla bla bla, please click on this link.%0D%0D http://www.website.com/script.php?t=v&pc="+pc+"%0D%0DThanks,%0DRyan";
var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message;
win = window.open(mailto_link,'emailWindow');
win.close();
}
It seems to work fine except once it gets to the '&' in the mail client it stops and dosn't write anymore text. I also tried replacing the '&' with a '&' and that also wouldn't work.
Any Ideas?
Thanks,
Ryan
1) Create a form.
2) Place a hidden input in the form.
3) Set the text of the hidden input as required.
4) Set the action of the form to mailto:whatever@...
5) submit the form.
I think you can specify the email subject in the form action but it's a long time since I tried this.
The downside of this aproach is that the text is preceded by fieldname=.
I'm not sure that using %0D is the best way to specify a line break. You should probably use \n to ensure platform independence but, again, it's a long time since I've tried this.
Kaled.
What do you get when you print the value of body_message to a webpage? You may have to venture into PHP or ASP to work around this.
In the meantime, maybe all you smarties out there that think mailto: is a bad idea can actually prove they know something about this and help him with a fix?
[edited by: inveni0 at 7:33 pm (utc) on Oct. 19, 2006]
[website.com...]
Then, on the page that's doing the loading, you can have code that will split the 'c' variable into the 't' and 'pc' variables you require at the '.'
Just an idea if nothing else pans out.