Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2004, 06:55 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open email program

Hi,
i am trying to open my email program so the user can fill in the body.
The textbox txtMail holds the email adress to where the mail has to be sent. I can send it automatically but that's not what i want.
I have already tried with :

Sysem.Diagnostics.Process.start("mailto:" + txtMail.text)

Then i get an errormsg which says :
System.componentmodel.win32Exception. the system cannot find the file specified.

Is there something wrong with my coding or have i forgotten something ?



 
Old June 7th, 2004, 07:31 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Whare are u using this code?
in aspx.vb file?

Om Prakash
 
Old June 7th, 2004, 07:31 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Where are u using this code?
Is it in aspx.vb file?

Om Prakash
 
Old June 7th, 2004, 08:57 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

All you need is a standard A tag (or hyperlink control) in your markup:

<a href="mailto:[email protected]">Click to Email</a>

Demo: Click to Email
 
Old June 7th, 2004, 09:03 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, i know you can fulfill this with a hyperlink but i want it to be opend when i click a button.
For example : I want to open the email program when i click the button btnSend. This button gets the value from txtMail which holds the email adress.
I placed the code in my codebehind file, under the sub btnSend_click



 
Old June 7th, 2004, 09:20 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't do this because ASP.NET is running on the server. You can't tell the client to do something with anything other than HTML and JavaScript.

You could do a Response.Redirect to the mailto address which would cause the browser to launch the client's email client:

Response.Redirect("mailto:[email protected]")
 
Old June 7th, 2004, 09:25 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx, works fine !!!


 
Old June 9th, 2004, 11:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

try this:
Code:
<a href="mailto:<s>[email protected]</s>?Subject=[u]Subject_Text</u>&Body=[u]Body_Text</u>">Click to Email</a>
HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need macro to send email via default mail program chutchinson Excel VBA 0 September 27th, 2007 09:28 PM
Email marketing - open rates ghari Pro PHP 1 June 23rd, 2006 11:06 PM
asp can't open db when db open by other program datuk Classic ASP Professional 3 June 13th, 2006 06:10 PM
Launching a program/open a file through VBA biglazy Access VBA 3 February 28th, 2006 04:30 PM
open a formatted excel file from program darvarin C++ Programming 1 June 15th, 2005 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.