This is the code that i have used for sending an E- mail: But the E-mail sending is getting failed every time plz give your valuable suggestions to solve this problem it's Urgent thanxx.....
    MailMessage mail = new MailMessage();
    mail.From = new MailAddress("");
    mail.Subject = "hello";
    mail.Body = "good one";
    mail.IsBodyHtml = true;
    SmtpClient smtp = new SmtpClient();
    smtp.Host = ""; //Or Your SMTP Server Address

    smtp.Port = 465; //also tried 587
    smtp.Credentials = new System.Net.NetworkCredential
    ("", "***********");  //my id and password      
    smtp.EnableSsl = false;
    Response.Write("<script language='javascript'>alert('MAIL SENT');</script>");
Re: unable to send mail in need help urgent!!! 80 80

I think there is no need to assign the port.
It might work.
Comment the following code


and then try to send.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.