473,657 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issuing a mailto:

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.redire ct
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 the mailto
content before issuing the command.

Any Suggestions? Am I going about this the right way?

Brian
Nov 19 '05 #1
3 1917
build your info, pass it back to the client through a javascript
"window.ope n()" perhaps.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Brian" wrote:
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.redire ct
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 the mailto
content before issuing the command.

Any Suggestions? Am I going about this the right way?

Brian

Nov 19 '05 #2
The first point to make is that mailto: is not covered by internet standards
and is generally considered bad practice for anything other than a simple
"contact me" link. For instance, it won't work if the user uses webmail or
hasn't properly configured the default email client.

specifying the body text as part of the link only works with certain
combinations of browser and mail client (IIRC it works in with IE and
Outlook Express but not Outlook)

my preference would normally be to send the email from the server (in
asp.net use System.Web.Mail ). however, this does assume that your server has
access to an smtp server that can send the mail.

if you want to use mailto with dynamically generated text, and
response.redire ct doesn't work, my next best guess would be to use something
like:

<body onload='documen t.location.href ="mailto:bla h blah<%=the server
generated content"%>'>

I haven't tested it so I don't know if that would work, but if it doesn't, I
can't think of any solution.

Andy
"Brian" <br***********@ gmail.com> wrote in message
news:eq******** *****@TK2MSFTNG P10.phx.gbl...
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.redire ct 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 the mailto content before issuing the command.

Any Suggestions? Am I going about this the right way?

Brian

Nov 19 '05 #3
Thank you for the heads up on the issues with mailto. These are not an issue
in my case where this will be running in a controlled environment over our
Intranet. An the functionality was explicitly asked for.

After playing around some, I found the hyperlinkbutton works, but it is ugly
and doesn't get displayed the same way that my other buttons are. So I
thought of hiding it and causing a click from code, but there doesn't appear
to be a way to do this.

Anyway, I will have a look at you suggestion and keep digging.

Thanks

Brian
"Andy Fish" <aj****@blueyon der.co.uk> wrote in message
news:eQ******** ******@TK2MSFTN GP10.phx.gbl...
The first point to make is that mailto: is not covered by internet
standards and is generally considered bad practice for anything other than
a simple "contact me" link. For instance, it won't work if the user uses
webmail or hasn't properly configured the default email client.

specifying the body text as part of the link only works with certain
combinations of browser and mail client (IIRC it works in with IE and
Outlook Express but not Outlook)

my preference would normally be to send the email from the server (in
asp.net use System.Web.Mail ). however, this does assume that your server
has access to an smtp server that can send the mail.

if you want to use mailto with dynamically generated text, and
response.redire ct doesn't work, my next best guess would be to use
something like:

<body onload='documen t.location.href ="mailto:bla h blah<%=the server
generated content"%>'>

I haven't tested it so I don't know if that would work, but if it doesn't,
I can't think of any solution.

Andy
"Brian" <br***********@ gmail.com> wrote in message
news:eq******** *****@TK2MSFTNG P10.phx.gbl...
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.redire ct 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 the mailto content before issuing the command.

Any Suggestions? Am I going about this the right way?

Brian


Nov 19 '05 #4

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

Similar topics

2
13283
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
15
24734
by: nAmYzArC | last post by:
Hi everyone, I'm setting the body of an email using values from a form firstname = bob lastname = dole ebody = 'First Name: ' + firstname + '\r\n' + 'Last Name: ' + lastname window.location.href = 'mailto:myemail@mycompany.com?subject=test
12
2954
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
15
29904
by: Val | last post by:
Any experts on mailto: tags? I want to set a link so that the subject and some of the body of the email is filled in. This is easy for simple text, although you need to use %20 for spaces: <a href="mailto:nobody@nowhere.com ?subject=Your web site &body=This%20is%20the%20%body!"> click here</a>
18
28338
by: Shinin | last post by:
I am trying to set up a mailto: link so that the actual address that the email is being sent to is obscured and replaced by a name. For example, I have <a href="mailto:jschmoe@abc.com">Joe Schmoe</a>. When this link is clicked, an email window appears in the clicker's email client where the To: field is jschmoe@abc.com. What I want to have displayed there is Joe Schmoe. I've seen it suggested that formatting the link like this: <a...
10
17291
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>
6
1750
by: cj | last post by:
I'm tryin to set up a sqlcommand in VB.NET that would issue the command: insert into server1.database.owner.table select * from server2.database.owner.table Since this sqlcommand has it's connection property set to a connection string for server1 I'm assuming it isn't seeing server2 -- I get invalid object name server2. How can I get one sql statement to reference multiple servers?
4
3391
by: Randy | last post by:
Hello, I'm trying to find out if it is possible, and if so...how to accomplish issuing a PLSQL command from within C#. The command is... SET SCAN OFF; What is happening is I'm trying to insert/update records with strings which contain "&" (this causes a prompt in oracle for a parameter) and this causes the query to fail in C#. I need to turn it off just for my application and then turn it back on after updating. I need to be able to do...
2
6320
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Hi, I want to create a mailto link from data coming from an SQLDataSource. How do I have to change the following code to get it working? The mailto works, outlook starts with a new message, but the email address has not been filled in because I don’t know how to pass the email variable into the mailto command. <asp:HyperLink runat="server"> <A href="mailto:">
0
8395
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
8826
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...
0
8605
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
7330
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...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.