How can you send an email message from an ASP.NET Web page?
I want an application on Asp.Net, In this i want to send email with my application, So tell me how i can send an email.
If you are still here
You can very easily send an email from ASP.NET
System.Web.Mail namespace is the first thing you need:
<%@ Import Namespace="System.Web.Mail" %>
While you send an email it requires the following points as sender, recipient, subject and body going under SmtpMail.Send().
And here is an examples:
string from = "email@example.com";
string to = "firstname.lastname@example.org";
string subject = "Good day!";
string body = "Any news?";
SmtpMail.SmtpServer = "mail.example.com";
SmtpMail.Send(from, to, subject, body);
The SmtpMail.SmtpServer means that you are to specify the mail server that used to deliver the message.
Thanks for your information.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread