Link to home
Start Free TrialLog in
Avatar of itimes
itimes

asked on

Mailto using document.location="mailto:"

Hi

I need to create a Mailto with javascript as a form is submitted

the only problem is as my E-mail message has got larger i get an error message :

"Cannot peform this operation bacause the default mail client is not properly installed"

Now up until the last few words i add to this string it works fone with no erors ... is there a limitt on the amount of text you can add to teh body in this way ???


CODE :

document.location="mailto:"+document.Int.appEmail.value+"?subject=Re: Details - " +Intdate+"&body=Hi " + name + "%0D%0A%0D%0A" + "I just want to confirm details" + "%0D%0A%0D%0A" + "ONE: " + document.Int.ONE.value + " and the TWO is:" + "%0D%0A%0D%0A" + document.Int.TWO.value + "%0D%0A%0D%0A" + "the item is : " + Intdate + " with " + document.Int.int2.value + ", " + document.Int.int2t.value + "%0D%0A%0D%0A" + "Comments: " + document.Int.intcomments.value + "%0D%0A%0D%0A" + "Shiiping Code: " + document.Int.Code.value + "%0D%0A%0D%0A" + " Kind Regards"
SOLUTION
Avatar of caner_elci
caner_elci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itimes
itimes

ASKER

caner_elci,

Tried this and still get teh same error ...

mplungjan,

If there is a limit surley "window.open" should work then as there is not form of posting being done there ???

HElp ....
I tried it and it works.. what browser are you using?
Avatar of itimes

ASKER

IE 6.1 for WIN98

This is teh exact code :

window.open("mailto:"+document.Int.appEmail.value+"?subject=Re: Your Interview Details - " +Intdate+"&body=Hi " + Candidatename + "%0D%0A%0D%0A" + "I just want to confirm your interview details" + "%0D%0A%0D%0A" + "The Client is " + document.Int.client.value + " and the position is:" + "%0D%0A%0D%0A" + document.Int.Position.value + "%0D%0A%0D%0A" + "Your Interview Date and Time is : " + Intdate + " and will be with " + document.Int.intwith.value + ", " + document.Int.intwithjt.value + "%0D%0A%0D%0A" + "Comments: " + document.Int.intcomments.value + "%0D%0A%0D%0A" + "Dress Code: " + document.Int.Dress_Code.value + "%0D%0A%0D%0A" + "I suggest you visit");
window.open and location= is the same. Both are using get

Michel
Avatar of itimes

ASKER

Turned out to be a Bug on win98 and ie 6 as theres seems to be a limit on teh amout of body text you can assign froma mailtyo ... works great on XP win2000