Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 7th, 2004, 06:55 AM
Authorized User
 
Join Date: Jun 2003
Location: Turnhout, Antwerp, Belgium.
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 ?



  #2 (permalink)  
Old June 7th, 2004, 07:31 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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

Om Prakash
  #3 (permalink)  
Old June 7th, 2004, 07:31 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
  #4 (permalink)  
Old June 7th, 2004, 08:57 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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:user@domain.com">Click to Email</a>

Demo: Click to Email
  #5 (permalink)  
Old June 7th, 2004, 09:03 AM
Authorized User
 
Join Date: Jun 2003
Location: Turnhout, Antwerp, Belgium.
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



  #6 (permalink)  
Old June 7th, 2004, 09:20 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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@address.com")
  #7 (permalink)  
Old June 7th, 2004, 09:25 AM
Authorized User
 
Join Date: Jun 2003
Location: Turnhout, Antwerp, Belgium.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx, works fine !!!


  #8 (permalink)  
Old June 9th, 2004, 11:41 PM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
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>user@domain.com</s>?Subject=[u]Subject_Text</u>&Body=[u]Body_Text</u>">Click to Email</a>
HTH.

Always:),
Hovik Melkomian.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:29 AM.


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