Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 OutLook Email

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2007-12-21 : 15:38:30
Hi,

System.Diagnostics.Process.Start("mailto:address@domain.com")

The above code works perfectly with VS.Net2005 but it doesn't work in VS.Net2003 and i am getting the error message as


The parameter is incorrect
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: The parameter is incorrect

Source Error:


Line 47:
Line 48: Private Sub cmdemail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdemail.Click
Line 49: System.Diagnostics.Process.Start("mailto:address@domain.com")
Line 50: End Sub
Line 51: End Class

Any Idea?
Thx





spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-12-21 : 17:05:06
so you're startign the outlook on the web server why?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-12-21 : 17:36:53
quote:
Originally posted by spirit1

so you're startign the outlook on the web server why?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out




Hi,

Because it is simpler to use. Wonder why the same code doesn't work with VB.NET 2003 ? Any Idea
Thx
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-12-21 : 17:54:50
no way can this be running on a server. this must be in a client app.

do you have ShellExecute set to true? I think it needs to be true for this to work.


elsasoft.org
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-12-21 : 18:03:05
quote:
Originally posted by jezemine

no way can this be running on a server. this must be in a client app.

do you have ShellExecute set to true? I think it needs to be true for this to work.


elsasoft.org




You are right.! Here is my code, Just One line. it works on vb.net2005. Any idea why it doesn't work on vb.net2003.?


Protected Sub cmdemail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdemail.Click
System.Diagnostics.Process.Start("mailto:")
End Sub
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-12-21 : 20:12:50
try something more like this:


using (System.Diagnostics.Process p = new System.Diagnostics.Process())
{
p.StartInfo.FileName = "mailto:address@domain.com";
p.StartInfo.UseShellExecute = true;
p.Start();
}


this is how you would do it in C#. vb syntax is similar probably. not sure as I hate vb syntax and refuse to learn it


elsasoft.org
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-12-26 : 11:27:08
quote:
Originally posted by jezemine

try something more like this:


using (System.Diagnostics.Process p = new System.Diagnostics.Process())
{
p.StartInfo.FileName = "mailto:address@domain.com";
p.StartInfo.UseShellExecute = true;
p.Start();
}


this is how you would do it in C#. vb syntax is similar probably. not sure as I hate vb syntax and refuse to learn it


elsasoft.org



Hi,

I tried this, Still i am not getting this. I am getting an error
"The parameter is incorrect StackTrace at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) "
Any Idea ?
Thx
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-12-28 : 14:50:00
quote:
Originally posted by vk18

quote:
Originally posted by jezemine

try something more like this:


using (System.Diagnostics.Process p = new System.Diagnostics.Process())
{
p.StartInfo.FileName = "mailto:address@domain.com";
p.StartInfo.UseShellExecute = true;
p.Start();
}


this is how you would do it in C#. vb syntax is similar probably. not sure as I hate vb syntax and refuse to learn it


elsasoft.org



Hi,

I tried this, Still i am not getting this. I am getting an error
"The parameter is incorrect StackTrace at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) "
Any Idea ?
Thx




I was able to get this going using Java Script, How ever i want to attach a pop up pdf file to this Default open Email Client. As i am using WebForms i couldn't find any. Do you guys have any idea?
Thx
Go to Top of Page
   

- Advertisement -