Control Panel
Forum
Hosting Help
ASP.NET 4 & SQL 2008 R2 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
New Features
|
Advertise
|
Tutorials
|
Silverlight Tutorials
|
Product Reviews in India
|
Exam 70-680 Practice Tests
|
Silverlight games
Total
members
:
153214
Average new registrations per day (in last 7 days):
100
New Registration:
Open
Register Now
Learn Windows 7:
Acer newTouch P400 Review
Before the arrival of the first devices in Windows 7, Acer continues to use version 6.5 of Microsoft operating system. The Windows Mobile platform is newTouch P400 with a host of good quality but is exceeded in many areas.
Want to become a DBA ?
SQL Server 2008 training courses
- by AspSpider team
Home
»
Resources
»
how to send a email by asp.net
ASP.NET
ADO.NET
Web Services
Remoting
Visual Studio 2005
Error Bank
Interview Questions
Tips & Tricks
XML
HTML
Jscript/Javascript
IIS
Windows
General
Submit Resource or code snippet
... and get
surprise gifts
Win Digital camera, ASP.NET Books, Free softwares!!
how to send a email by asp.net
09 Jun, 2010
Author:
lingfeng
http://aspspider.ws/teamosj
welcome to my space
Summary
how to send a email by asp.net
.NET Classes used :
.Net 2.0
string EmailContent = Request.Form[content].ToString();
MailAddress message = new MailAddress(emailaddress, title);
MailMessage mymail = new MailMessage();
mymail.From = message;
string messageto = toaddr.Text;
mymail.To.Add(messageto);
Attachment MsgAttach = new Attachment(this.FileUpload1.PostedFile.FileName mymail.Attachments.Add(MsgAttach);
mymail.Subject = mailtitle.Text;
mymail.Body = EmailContent;
mymail.IsBodyHtml = true;
mymail.BodyEncoding = System.Text.Encoding.GetEncoding(GB2312);
mymail.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
client.Host = smtp.gmail.com;
client.Credentials = new NetworkCredential(emialaddess, pwd);
try
{
client.Send(mymail);
Label1.Text = success;
}
catch
{
Label1.Text = Error;
}
}
Feedbacks about this page from members:
Sending Mail
-
Piyush
YOu can send your mail using SMTP Class.
However, if you are under some kind of proxies then you have to come up with the solution so that you can make the ssh tunnel connection.
(29 Jun 2010)
Submit Feedback
View All Feedbacks
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.