Solved

Mailto using document.location="mailto:"

Posted on 2004-04-16
9
1,843 Views
Last Modified: 2011-08-18
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"
0
Comment
Question by:itimes
  • 3
  • 2
  • 2
9 Comments
 
LVL 4

Assisted Solution

by:caner_elci
caner_elci earned 30 total points
ID: 10841066
try this window.open instead.. for example:

<html>
<script language=javaScript>
function doIt()
{
window.open("mailto:caner_elci@mail.address?subject=Re: Details&body=Hi Caner%0D%0A%0D%0AI just want to confirm details%0D%0A%0D%0AKind Regards");
}
</script>
<a href="#" onClick='doIt();'>do it</a>
</html>
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 30 total points
ID: 10841473
Yes there are limitation on GET

Michel
0
 

Author Comment

by:itimes
ID: 10841506
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 ....
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 4

Expert Comment

by:caner_elci
ID: 10841548
I tried it and it works.. what browser are you using?
0
 

Author Comment

by:itimes
ID: 10841576
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");
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 10841740
window.open and location= is the same. Both are using get

Michel
0
 

Author Comment

by:itimes
ID: 11342349
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
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now