I have a library function which may help:
public static void SendEmail(string emailAddress, string emailSubject,
string emailBody)
{
Process newProc = new Process();
string email = "mailto:" + emailAddress + "?subject="+ emailSubject +
"&body=" + emailBody;
newProc.StartInfo.FileName = email;
newProc.Start();
}
Hi Peter,
My query was geared towards finding which application serves as a mail
client on the machine. I can, then, easily start it using, of course,
the Process class. Any library/namespace will do fine as long as it
does the job. I wanted to find something as easy and as straight-
forward as using the HTML's "mailto:" option in an Anchor's href,
whereby the browser itself can find the mail client, start it, and pre-
populate the "To:" field.
At any rate, your link gives me valuable info to use in another
application I am currently building, coincidentaly.
Jeff,
I will give it a world...but I am a little hazy on how would one
determine what exe-file to start. In other words; what is the "email"
in "newProc.StartInfo.FileName = email;"
In going through an internet search, I came up with
Registry.ClassesRoot
.OpenSubKey("mailto")
.OpenSubKey("shell")
.OpenSubKey("open")
.OpenSubKey("command")
With additions to make it a string and strip away any double quotes
and put in email fields syntax...using ToString() and Replace() and
what have you...
This is giving me some little problems, which I will get straightened
out in time.
I was kind-of hoping to be shielded from all of that, and just use a
library method from somewhere in the annals of .Net. But I guess I
have to put some elbow grease into this.
Thanks to both of you,
If you think of something else, please let me know.
jake