Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 5th, 2003, 05:47 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to open a new mail from a Windows App

Hello,

I want to allow the user to mail me by clicking a button on a Windows Form the same way I can set up a mailto-link on a web-page.

I tried the following syntax:
   System.Diagnostics.Process.Start("mailto:johan.seg [email protected]")

When the statement is executed no mail pops up but an exception is thrown:
   An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll
   Additional information: ERROR_IPSEC_IKE_NEG_STATUS_END

That exception did not tell me anything so I tried using ShellExecute directly. The return value was 5 which is an error code for "Access is denied". (I have done the same thing in VB6 and it worked.)


How can I set up my computer/application/assembly to receive the proper rights?


Thanks
Johan
 
Old June 16th, 2003, 10:45 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm replying to myself as I figured out the problem.
The syntax works. And it's not a .Net security problem.

However I had declared my 'static void Main' without the STAThread-attribute. After I added it mailing works.

Johan





Similar Threads
Thread Thread Starter Forum Replies Last Post
implementing more than one windows in an app helloise C# 4 November 10th, 2008 12:42 PM
Can't Debug Windows App? Ron Howerton Visual Studio 2005 5 November 30th, 2007 05:20 PM
Windows Standalone app echovue Visual Basic 2005 Basics 3 March 12th, 2007 03:27 PM
Accessing Windows service from a windows app sajid08 C# 1 October 6th, 2006 10:25 AM
Open web app maximised. GuyB ASP.NET 1.0 and 1.1 Basics 1 May 11th, 2006 09:07 PM





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