?
Solved

Mailto using document.location="mailto:"

Posted on 2004-04-16
9
Medium Priority
?
1,874 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
9 Comments
 
LVL 4

Assisted Solution

by:caner_elci
caner_elci earned 90 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 90 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

650 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