Open Mail Client using ASP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In my webform, I've a checkbox and when it's checked, i want to open the
client's email program (outlook, mozila and so..), add the the "to" and
"subject" to that mail.
I tried this code:
string toEmail = "Gidi Shwartzman <[email protected]>";
string subject = "I'd like to participate in CP Besketball";
string message = string.Format("mailto:{0}?subject={1}", toEmail,
subject);

Process.Start(message);
}

when I run this webpage from the visual studio, it works fins.
but when I try to access the webpage from another pc by http, the process
won't start.

what's wrong?

Thanks.
 
You are not going to be able to run the mail client from an asp page due to
a security risk.
 
Hi,


Your code does not work in a web environment. Not only that but
Process.Start start a process int he server, not in the client side!

Your solution is to use a <a href="mailto: > tag.
 

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

Back
Top