Transport Failed to connect to the Server.

S

Sudhan

When i am trying to send in asp.net i am geting this Error
Message:Transport Failed to connect to the Server. I am using SMTP
server in my localMachine and Sify connction
I am New to ASP.Net
MY Code:
private void Button1_Click(object sender, System.EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To=Request.Form["to"];
mail.From =Request.Form ["from"];
if (Request.Form["format"].Equals("text"))
mail.BodyFormat = MailFormat.Text;
else
mail.BodyFormat = MailFormat.Html;
mail.Subject =Request.Form["subject"];
mail.Body = Request.Form["body"];
SmtpMail.SmtpServer="asmtp.sifybroadband.com";
SmtpMail.Send(mail);
Response.Flush();
Message.Text="Message Sent....<br><br>"+
"<a href=\"sendMail.aspx\">Go Back</A>";

}


Error Shows in this line SmtpMail.Send(mail);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top