TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
parimal patel
NA
20
0
having problemin sending email with asp.net2.0 C#
Feb 23 2009 1:35 PM
can anyone help for below code its not working .
try
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress(txtemail.Text);
mail.To.Add("username");
mail.Subject = "Regarding Reservation";
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.Body = txtfname.Text;
mail.Body = txtlname.Text;
mail.Body = txtAdd1.Text;
mail.Body = txtAdd2.Text;
mail.Body = txtcity.Text;
mail.Body = txtstate.Text;
mail.Body = txtzip.Text;
mail.Body = txtph.Text;
mail.Body = txtemail.Text;
mail.Body = txtnoroom.Text;
mail.Body = txtroomtype.Text;
mail.Body = txtarr.Text;
mail.Body = txtdep.Text;
mail.Body = txtadult.Text;
mail.Body = txtchild.Text;
mail.Body = txtsmo.Text;
mail.Body = txtcomment.Text;
mail.IsBodyHtml = true;
mail.Priority = MailPriority.Normal;
SmtpClient client = new SmtpClient();
client.Host = "smtp.yahoo.com";
client.Port = 25;
client.UseDefaultCredentials = true;
client.Credentials = new System.Net.NetworkCredential("username","password");
client.Send(mail);
}
catch(Exception ex)
{
ex.ToString();
}
error:-- time out.
Thanks in advance
Reply
Answers (
5
)
pop up of a visual studio 2008
Courseware Demo Download - 12 Popular Titles Free (Microsoft/Cisco/PMI/CISSP/A+)