IIS C# : Some times Mail goes straight a way in to Queue Folder in no time

Started by nomad, Jun 26, 2009, 10:59 AM

Previous topic - Next topic

nomad

Test Case One :
Quote
<system.net>
    <mailSettings>
      <smtp>
        <network host="127.0.0.1" defaultCredentials="true" userName="*******" password="*******"/>
      </smtp>
    </mailSettings>
  </system.net>
Test Case Two :

Quoteprotected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(TextBox1.Text);
            mail.To.Add(TextBox2.Text);
            mail.Subject = TextBox4.Text;
            mail.Body = TextBox5.Text;

            SmtpClient mailClient = new SmtpClient();
           //mailclient.host="127.0.0.1";
            mailClient.Send(mail);
           
        }
        catch (Exception er)
        {
            Label4.Text = er.Message;
        }
    }

Mail Sending Programm Works But SMTP Fails to send mail .. it Works randomly.. ( i got mail few times from the code )
But it works Randomly. Some times Mail goes straight a way in to Queue Folder in no time . Why is that Happens ?

can some explain me how SMTP send mails to Other Servers ?