473,466 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Bring up outlook client from ASP.Net

Hi,

I have a ASP.Net button in a webform. What I like to do, if this button is
clicked, the page should connect to a SQL server run some stored procedure,
then bring up user's MS Outlook client and fill in the mail to address,
subject and body using the dataset returned by stored procedure. I know how
to connect to SQL and get dataset back, I don't know how to bring up
Outllook on client side and fill in mailto, subject and body.

BTW, All our user computers are configured to use MS Outlook as default
email agent .

TIA
Nov 19 '05 #1
2 1750
Hi Rayomond,

Pls check the link
http://www.outlookcode.com/d/code/formonweb.htm

regards
charmis
"Raymond Du" <rd**@yahoo.com> wrote in message
news:%2*****************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a ASP.Net button in a webform. What I like to do, if this button is
clicked, the page should connect to a SQL server run some stored
procedure,
then bring up user's MS Outlook client and fill in the mail to address,
subject and body using the dataset returned by stored procedure. I know
how
to connect to SQL and get dataset back, I don't know how to bring up
Outllook on client side and fill in mailto, subject and body.

BTW, All our user computers are configured to use MS Outlook as default
email agent .

TIA

Nov 19 '05 #2
Raymond, if you're just trying to fill in the To/Cc/Subject, there might be
an easier way.

When the user clicks the button, do your database query and construct a
mailto Url, something in the following format;

mailto:[ your To addresses ]&Cc=[ Any Cc addresses ]&Subject=[ The Subject ]

e.g....

mailto:bo*@bobware.com&C******@bobware.com&Subject =Hey how's it going

If you then do a Response.Redirect to this Url, I expect that IE will create
a new mail message using your defailt email client nicely.

The effect should be, user clicks the button and the email form appears...
essentially no other complications.

You will probably need to Server.UrlEncode the actual data that you put in
place of the [bracketed] text, as in;

string szUrl, szToAddresses, szCcAddresses, szSubject;

// do your db query, set the To, Cc, and Subject vars

// create the Url
szUrl = String.Format (
"mailto:{0}&Cc={1}&Subject={2}",
Server.UrlEncode (szToAddresses),
Server.UrlEncode (szCcAddresses),
Server.UrlEncode (szSubject)
);

Trace.Write ("Mailto Url: " + szUrl); // for debugging

// force the browser to process the new Url
Response.Redirect (szUrl);
/// M
"charmis" <ch*****@hotmail.com> wrote in message
news:#S**************@tk2msftngp13.phx.gbl...
Hi Rayomond,

Pls check the link
http://www.outlookcode.com/d/code/formonweb.htm

regards
charmis
"Raymond Du" <rd**@yahoo.com> wrote in message
news:%2*****************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a ASP.Net button in a webform. What I like to do, if this button is clicked, the page should connect to a SQL server run some stored
procedure,
then bring up user's MS Outlook client and fill in the mail to address,
subject and body using the dataset returned by stored procedure. I know
how
to connect to SQL and get dataset back, I don't know how to bring up
Outllook on client side and fill in mailto, subject and body.

BTW, All our user computers are configured to use MS Outlook as default
email agent .

TIA


Nov 19 '05 #3

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

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
0
by: Jeff Mikels | last post by:
Here is a python script to synchronize Palm Desktop Datebook files with Outlook's Calendar I'm releasing it under the Python license as version 0.1. ...
3
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model...
3
by: Ed Sutton | last post by:
How can I show the email client UI so the user can send the attachment to the desired recipient. I get an exception if I leave the MailMessage.To property blank. Is there any way to do this? I...
11
by: Maximus | last post by:
Hi all, Has anyone been able to reterive the gradient selection colors used in outlook 2003? Basically, I have a grid showing a list of records and my client wants the selected row to have the...
5
by: John A. Bailo | last post by:
I have a program that I'm converting from Outlook 2000 to Outlook 2003. It basically opens Outlook and iterates through a series of items in a public folder. I was able to run this as a...
5
by: xin.yadong | last post by:
Is there a way to create an New Outlook Email from an ASP.NET application? I can not use "mailto:", since it is only support a string less than 512. I have find a good way from link :...
23
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
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...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.