Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How to Send Email In Asp.net 2.0
Dipali Patil
Oct 25 2010 5:10 AM
8.5k
Reply
How to Send Email In Asp.net 2.0 ?
I use following code but it is not work ......
string
UserFNameCase = txtname.Text;
string
dsCenter = ddlDistribution.SelectedItem.Text;
string
MailSub =
"Registration Information."
;
string
EventDescription =
"<html><body> Dear "
+ UserFNameCase +
", <br /> Your Serial No is <b>"
+ SerialNo +
"</b> . Please collect your Id card From <b>"
+ dsCenter +
" </b> after 2 bussiness days .</body></html>"
;
MailMessage
mail =
new
MailMessage
();
mail.IsBodyHtml =
true
;
mail.Subject =
"Registration Information."
;
mail.Body = EventDescription;
mail.From =
new
MailAddress
(
"
[email protected]
"
);
mail.To.Add(txtEmail.Text);
SmtpClient
smtp =
new
SmtpClient
(
"localhost"
);
//smtp.Host = "127.0.0.1";
smtp.Host =
"LocalHost"
;
smtp.Credentials =
new
NetworkCredential(
"username"
,
"secret"
);
////smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
smtp.Send(mail);
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Need to get number of days from Datetime
Beginner Problem with StreamWriter