Solved

Mailto using document.location="mailto:"

Posted on 2004-04-16
9
1,861 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 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

729 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