473,385 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Using mailto: to mail a link containing a querystring

I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.location='mailto:or@mailadr.se?body=http://myWebserver/page.asp?docID=17&login=HAL&subject=report';
</script>

This all looks well but when I se the actual mail the &login=LAS part
of the link in the body is not there! The subject is correct! It all
looks ok apart from the missing part of the links querystring.

I tried to use Server.UrlEncode but that just left the body of the
mail compleatly empty.

/best regards Olaf
Jul 23 '05 #1
5 4036
Olaf wrote on 09 aug 2004 in comp.lang.javascript:
I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.location='mailto:or@mailadr.se?body=http://myWebserver/page.as
p?docID=17&login=HAL&subject=report'; </script>

This all looks well but when I se the actual mail the &login=LAS part
of the link in the body is not there! The subject is correct! It all
looks ok apart from the missing part of the links querystring.

I tried to use Server.UrlEncode but that just left the body of the
mail compleatly empty.


How would the last two "&"s know which "?" they have to follow?

In other words:

the mail body could contain:
http://myWebserver/page.asp?docID=17
and the mail login:
HAL
and the mail subject:
report

but there is no mail login, so where has HAL to go?.

Again in other words: you cannot do that.

Moreover the "mailto'-protocol is not clearly defined over different mail
clients.

===========================

If you really want to get somewhere try this:

document.location=
'mailto:or@mailadr.se?body=http://myWebserver.se/docID17.HAL.report.xyz'

and when the recipient wants to connect your customized 404.asp page will
detect .xyz and redirect this nonexisting URL to where it should be
(page.asp) and have docID17, HAL and report in session variables.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #2
Ivo
"Olaf" wrote
I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.location='mailto:or@mailadr.se?body=http://myWebserver/page.asp?doc
ID=17&login=HAL&subject=report'; </script>

This all looks well but when I se the actual mail the &login=LAS part
of the link in the body is not there! The subject is correct! It all
looks ok apart from the missing part of the links querystring.

I tried to use Server.UrlEncode but that just left the body of the
mail compleatly empty.


Use the built-in escape function to encode the url:
document.location='mailto:or@mailadr.se?body='+esc ape('http://myWebserver/pa
ge.asp?docID=17&login=HAL')+'&subject=report';

--Iv
Jul 23 '05 #3
In article <69**************************@posting.google.com >, Olaf
says...
I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.location='mailto:or@mailadr.se?body=http://myWebserver/page.asp?docID=17&login=HAL&subject=report';
</script>


Cool - a malformed URL. Chaos will ensue.

--
Hywel

http://sponsorhywel.org.uk/
Jul 23 '05 #4
On 9 Aug 2004 07:51:21 -0700, Olaf <ol***********@hotmail.com> wrote:
I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.location='mailto:or@mailadr.se?body=http://myWebserver/page.asp?docID=17&login=HAL&subject=report';
</script>

This all looks well but when I se the actual mail the &login=LASpart of
the link in the body is not there! The subject is correct!It all looks
ok apart from the missing part of the linksquerystring.

I tried to use Server.UrlEncode but that just left the body of themail
compleatly empty.


The mailto scheme is flawed and should be avoided. It would be much more
reliable to use a server-side mail script. There are plenty of them around
and you'll have no problems setting the subject, or any other field for
that matter.

I'll stop there though. This subject has been done to death.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail
Jul 23 '05 #5
"Ivo" <no@thank.you> wrote in message news:<41***********************@news.wanadoo.nl>.. .
Use the built-in escape function to encode the url:
document.location='mailto:or@mailadr.se?body='+esc ape('http://myWebserver/pa
ge.asp?docID=17&login=HAL')+'&subject=report';

--Iv


Thanks Ivo! That worked just the way I wanted it to.
best regards Olaf
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill Petrol | last post by:
I'm trying to send a link with a querystring as the body of an email message. My HTML syntax looks something like this: <a href="mailto:xxx@yyy.com?Subject=<? print $subject ?>&Body=<? print...
2
by: Joseph Ellis | last post by:
Hello all, I have as part of my family website a list of links to family members' e-mail addresses. So far I've just provided links in the form of href="mailto:somebody@domain.com". But now...
12
by: ElvisIsDead | last post by:
Have a script that takes a form and emails it automatically. Here is the part: <form onSubmit="return editData();" name="estm" enctype="text/plain" method="post"...
2
by: Nigi | last post by:
I've made a mysql database with php front end which, in part, contains mailing lists. I've used a mailto: link to create a new email with their names in the bcc: field. Unfortunatley their is a...
12
by: catyionic | last post by:
hi, Due to trying many different form options, with none of them working, I opted for this to receive info back from this site: http:\\www.elderslastwish.com <form name="feedback_form"...
10
by: Adam Smith | last post by:
How can I set up a mailto with a cc or bcc as well as a subject designation. The system works for two but not three, is this a hardwired limit or have I missed something ==> <a...
15
by: tshad | last post by:
I am trying to put an persons email address in a response I am sending another person. I can get it to work by doing the following: message.Body = resumeTop & vbCrLf & vbCrLf & "For Applicant:...
3
by: Brian | last post by:
Hi, I want to issue mailto from one of my pages. Basically to drop contact information from a from to the body of the email and have the user enter the desired address to send it to. I thought...
7
by: Richard | last post by:
Hi, the following snippet of HTML works fine for standard email clients but does not do so for web based email:- <A HREF="mailto:someone@nodename.demon.co.uk?subject=Freecycle%20Extension%2...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.