Tutorials
Resources
Forum
Interview
Jobs
Projects
Offshore Development
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Talk to Us
|
My Profile
Sign In
Register
AdSense Revenue
Gifts
Active Members
Today
Athira Appukut...
(253)
D.Jeya kumar(J...
(143)
vipul
(101)
Last 7 Days
Athira Appukut...
(1712)
D.Jeya kumar(J...
(1341)
Sridhar R
(1336)
more...
Sending Email in ASP.NET 2.0
Posted Date: 21 Jun 2008 Resource Type:
Articles
Category:
Web Applications
Posted By:
pradeep
Member Level:
Silver
Rating:
Points
: 10
things have changed from ASP.Net1.1 and ASP.Net 2.0, for email sending. The namespace has changed from System.Web.Mail to System.Net.Mail. and to get the email working, there are two classes that need to be addressed:
1) MailMessage()
2) SmtpClient()
To use these, it will look something like this:
using System.Net.Mail;//namespace
SmtpClient MailClient=new SmtpClient("127.0.0.1");
MailMessage Msg = new MailMessage(SenderAddress,ReceiptAddress);
Msg.Subject = "YourSubject";
string Message="";
Message="Thank you for registerting Jaadoo.net
";
Message += " Your EMail:" + txtEMail.Text.ToString() + "
";
Message += " Your Password:" + TxtPassword.Text.ToString() + "
";
Message += " ";
Msg.Body = Message;
Msg.IsBodyHtml = true;
try
{
MailClient.Send(Msg);
}
catch (System.Exception ex)
{
Response.Write(ex.toString());
}
Responses
Author:
Satyanarayan SushilKumar Bajoria
22 Jun 2008
Member Level:
Gold
Points
: 1
Hi,
Nice piece of code to explain how to send email in ASP.Net.
You explain in a much simpler way.
Keep posting such useful article.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Creating Thumbnail of images in ASP.NET
Previous Resource:
News section in asp.net
Return to Discussion Resource Index
Post New Resource
Category:
Web Applications
Post resources and
earn money
!
Related Resources
Webpart Deployment
Format Date
Managing Database Connections using ADO.NET
ASP.Net State Server Management in Webfarm and WebGarden
XML Namespace
dotNet Slackers
BizTalk Adaptors
Web Design
fax server
Contact Us
Privacy Policy
Terms Of Use