473,405 Members | 2,261 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,405 software developers and data experts.

Open Mail Client using ASP

Hi,

In my webform, I've a checkbox and when it's checked, i want to open the
client's email program (outlook, mozila and so..), add the the "to" and
"subject" to that mail.
I tried this code:
string toEmail = "Gidi Shwartzman <gi**@checkpoint.com>";
string subject = "I'd like to participate in CP Besketball";
string message = string.Format("mailto:{0}?subject={1}", toEmail,
subject);

Process.Start(message);
}

when I run this webpage from the visual studio, it works fins.
but when I try to access the webpage from another pc by http, the process
won't start.

what's wrong?

Thanks.

Sep 18 '07 #1
2 2308
Mel
You are not going to be able to run the mail client from an asp page due to
a security risk.

"Gidi" <sh*****@hotmail.com.dontspamwrote in message
news:16**********************************@microsof t.com...
Hi,

In my webform, I've a checkbox and when it's checked, i want to open the
client's email program (outlook, mozila and so..), add the the "to" and
"subject" to that mail.
I tried this code:
string toEmail = "Gidi Shwartzman <gi**@checkpoint.com>";
string subject = "I'd like to participate in CP Besketball";
string message = string.Format("mailto:{0}?subject={1}", toEmail,
subject);

Process.Start(message);
}

when I run this webpage from the visual studio, it works fins.
but when I try to access the webpage from another pc by http, the process
won't start.

what's wrong?

Thanks.

Sep 18 '07 #2
Hi,
Your code does not work in a web environment. Not only that but
Process.Start start a process int he server, not in the client side!

Your solution is to use a <a href="mailto: tag.

"Gidi" <sh*****@hotmail.com.dontspamwrote in message
news:16**********************************@microsof t.com...
Hi,

In my webform, I've a checkbox and when it's checked, i want to open the
client's email program (outlook, mozila and so..), add the the "to" and
"subject" to that mail.
I tried this code:
string toEmail = "Gidi Shwartzman <gi**@checkpoint.com>";
string subject = "I'd like to participate in CP Besketball";
string message = string.Format("mailto:{0}?subject={1}", toEmail,
subject);

Process.Start(message);
}

when I run this webpage from the visual studio, it works fins.
but when I try to access the webpage from another pc by http, the process
won't start.

what's wrong?

Thanks.

Sep 18 '07 #3

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

Similar topics

3
by: TLMM | last post by:
I have a Word doc already created that I want to open from an asp page. I want it to open in Word and allow the user to modify if necessary. I currently have it opening (using href), but it is...
13
by: Peter Amberg | last post by:
I would like to create a link on my page that opens the standard e-mail application when someone clicks it. It should have at least the subject preset, better if I could preset the body as well. I...
3
by: Gama Franco | last post by:
Hi, I'm working on a project based in Windows Forms, and I need to open the user's default e-mail client (a new e-mail) with some attachments ready to send. Since the destination of the e-mail...
1
by: vijaygparikh | last post by:
HI i am writting a code for open default mail client and it works fine. i want to attach a file with the default mail client but file is not attached with "mailto:" option. If any one has idea...
2
by: Hanika | last post by:
Going on 3 days and I am wodnering if I am just not looking in the right place. If anyone nows how to do this please please help me. I am developing a Windows form application using VB.NET 2005....
14
by: C | last post by:
Hi, From my ASP.NET application when the user clicksa button I want to be able to programmatically open Outlook, create a new mail, add attachments and set the body text. Is this possible? ...
4
by: Pavils Jurjans | last post by:
Hello list, In order to do some mail processing before it ever gets to the mail client, we plan to implement a POP3 proxy solution. Ie, POP3 mail client would connect to the proxy instead of the...
2
by: Arno R | last post by:
Hi, A client just called me this afternoon and said she had a problem. While trying to send mail from Access she sees the message: "Microsoft Access can't open the mail session. Check your mail...
0
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it...
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
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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
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...

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.