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
Amit Kumar
NA
140
40.8k
unable to send mail
Sep 19 2013 8:23 AM
i want to send sms from asp.net application . i have written this code for sending mail .
try
{
string filename = Server.MapPath("~/App_Data/FeedBack.txt");
string mailbody = System.IO.File.ReadAllText(filename);
mailbody = mailbody.Replace("##Name##", txtName.Text);
mailbody = mailbody.Replace("##Email##",txtEmail.Text);
mailbody = mailbody.Replace("##contact##",txtContact.Text);
mailbody = mailbody.Replace("##Commnect##",txtSuggestion.Text);
MailMessage myMessage = new MailMessage();
myMessage.Subject = "Responce from website";
myMessage.Body = mailbody;
myMessage.From = new MailAddress("
[email protected]
","Amit Kumar");
myMessage.To.Add(new MailAddress("
[email protected]
", "Amit Verma"));
SmtpClient mysmptclient = new SmtpClient();
mysmptclient.Send(myMessage);
formatTable.Visible = false;
lblMail.Text = "Your Feedback has been sent successfully";
lblMail.ForeColor = Color.Green;
}
catch
{
lblMail.Text = "unable to sent the feedback .Check your smpt server";
lblMail.ForeColor = Color.Red;
}
but after clicking on submit button i get a exception like "unable to sent the feedback .Check your smpt server"
i also configured smpt setting in web.config file
<system.net>
<mailSettings>
<smtp from="
[email protected]
">
<network host="smtpout.secureserver.net" password="myemailpassword" userName="
[email protected]
"/>
</smtp>
</mailSettings>
</system.net>
Reply
Answers (
2
)
Passing a selected record from one datagridview to another
how to create chat application in C#