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;
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>
<network host="smtpout.secureserver.net" password="myemailpassword" userName="
[email protected]"/>
</smtp>
</mailSettings>
</system.net>