How can I opening a new Outlook email message?

Q

Quick

All I want to do is have a user click on a link, an image, a button or
anything and have it launch an outlook new mail message window with a
supplied email address.

Something similar to how the HTML anchor tag works when you use
"mailto:"

Is this possible?

I working with a link colum in a DataGridView at the moment, but I'd
assume the functionality would be the same across all controls...

Any ideas would be appreciated.
 
J

Jeff Gaines

All I want to do is have a user click on a link, an image, a button or
anything and have it launch an outlook new mail message window with a
supplied email address.

Something similar to how the HTML anchor tag works when you use
"mailto:"

Is this possible?

I working with a link colum in a DataGridView at the moment, but I'd
assume the functionality would be the same across all controls...

Any ideas would be appreciated.

How about this:

public static bool SendEmail(string strEmailAddress)
{
bool blnOK = false;

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.RedirectStandardOutput = false;
p.StartInfo.FileName = "mailto:" + strEmailAddress;
p.StartInfo.UseShellExecute = true;
try
{
p.Start();
blnOK = true;
}
catch
{
blnOK = false;
}
return blnOK;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top