how to use asp.net page to send an email?

  • Thread starter Thread starter blu3g85
  • Start date Start date
Here is a link to an excellent FAQ on almost everything you wanted know
about emailing in .Net.

http://www.systemwebmail.com

--
- Paul Glavich
Microsoft MVP - ASP.NET


blu3g85 said:
how to use asp.net page to send an email?



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
This is simple method... u can try..

<%@ Page Language="C#" debug="true" %>
<% @Import Namespace="System.Web.Mail" %>

<script runat="server">

void MailtoUser(Object src, EventArgs e)
{

MailMessage objMail= new MailMessage();

objMail.To = "(e-mail address removed)";
objMail.From = "(e-mail address removed)";
objMail.Subject = "Registration Confirmation";
objMail.Body = " Thanks for your registration with us";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(objMail);
}
</script>

<html>
<body>

<form runat="server">
<asp:button runat="server" id="mailsend" Text="Click here to send mail"
OnClick="MailtoUser" />
</form>

</body>
</html>
 
Back
Top