Transport Failed to connect to the Server.

Discussion in 'ASP .Net' started by Sudhan, Dec 20, 2005.

  1. Sudhan

    Sudhan Guest

    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);
    Sudhan, Dec 20, 2005
    #1
    1. Advertising

  2. Sudhan

    Teemu Keiski Guest

    Hi,

    see this:

    http://www.systemwebmail.com/faq/4.3.9.aspx

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "Sudhan" <> wrote in message
    news:...
    > 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);
    >
    Teemu Keiski, Dec 20, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Lankford
    Replies:
    14
    Views:
    21,047
    naveenkumarmandava
    Jul 16, 2008
  2. Lori McDonald
    Replies:
    0
    Views:
    5,724
    Lori McDonald
    Feb 16, 2004
  3. =?Utf-8?B?bmJpc3NldHRl?=
    Replies:
    1
    Views:
    3,532
    jcallinan
    Oct 2, 2006
  4. Hawksey
    Replies:
    1
    Views:
    888
    rajanand_m
    Nov 6, 2009
  5. Nathan Sokalski
    Replies:
    5
    Views:
    585
    Ricky Yau
    Dec 11, 2006
Loading...

Share This Page