473,839 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.locati on='mailto:or@m ailadr.se?body= http://myWebserver/page.asp?docID= 17&login=HAL&su bject=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.UrlEncod e but that just left the body of the
mail compleatly empty.

/best regards Olaf
Jul 23 '05 #1
5 4070
Olaf wrote on 09 aug 2004 in comp.lang.javas cript:
I have a ASP page that after saveing data to the database it will
write the following script code to the page:
<script>
document.locati on='mailto:or@m ailadr.se?body= http://myWebserver/page.as
p?docID=17&logi n=HAL&subject=r eport'; </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.UrlEncod e 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.locati on=
'mailto:or@mail adr.se?body=htt p://myWebserver.se/docID17.HAL.rep ort.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.locati on='mailto:or@m ailadr.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.UrlEncod e but that just left the body of the
mail compleatly empty.


Use the built-in escape function to encode the url:
document.locati on='mailto:or@m ailadr.se?body= '+escape('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.locati on='mailto:or@m ailadr.se?body= http://myWebserver/page.asp?docID= 17&login=HAL&su bject=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.locati on='mailto:or@m ailadr.se?body= http://myWebserver/page.asp?docID= 17&login=HAL&su bject=report';
</script>

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

I tried to use Server.UrlEncod e 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.locati on='mailto:or@m ailadr.se?body= '+escape('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
13310
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 urlencode($url) ?>">Send an Email</a> (I've had to URLENCODE the variables first, and it works. If I don't do so, then it doesn't work.) The problem occurs when it is time to display the encoded version. It
2
6397
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 I'd like to rid my HTML of e-mail addresses and use PHP to pass a mailto: link to the browser, something like, href="email.php?person=grandma". Then in email.php I'd have something like (paraphrased), "if $person == 'grandma' then...
12
2985
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" action="mailto:user@domain.com?subject=Daily numbers&body=window.this.document"> I would like for it to open the default email program and let me choose an address from that form. Is this possible? Any suggestions are appreciated. Elvis
2
3819
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 limit on the size of a mailto: field that outlook can accept, and so it can't be used to mail more than about 80 people at a time. Our lists go up to 200. Can anyone suggest a workaround that will enable people to follow a link to a new email...
12
5584
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" method="post" action="mailto:mymail@yahoo.com?subject=Elder's Last Wish Application Form" enctype="text/plain">
10
17306
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 href="mailto:registrar@econ.com?cc=webmaster@econ.com?subject=Login Problems">The Registrar at econ.com</a>
15
3261
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: " & session("firstName") & " " & session("lastName") & vbCrLf & "Email: mailto:" & session("email") & vbCrLf & vbCrLf & resumeBottom When the email gets to the person, the email link works. The problem is
3
1922
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 that I could use response.redirect for this, but I get a "the page could not be displayed" error in my window and not the outlook window. I am initiating this from the onclick of a button. It does work with a HyperlinkButton, but I need to build...
7
4961
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 0Help%20File:-%20">Contact Me</A> Is there a script that would ensure that I can compose an email complete with address, subject line and some body text that will indeed work with gmail, hotmail and so on please?
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10650
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10295
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7019
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3136
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.