i am sending mail in asp.net using c#. Below i have pasted the C# code for sending mail but when i submit the form i am getting the error as Mailbox Unavailable.
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
//message.To.Add("xxx@gmail.com");
message.Subject = "Rental Agreement Form";
message.From = new System.Net.Mail.MailAddress("user@msssoftware.com");
message.To.Add("xxxx@gmail.com");
//message.CC.Add("xxxx@gmail.com");
message.IsBodyHtml = true;
message.Body = result;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com", 25);
smtp.Host = "localhost";
smtp.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
smtp.Send(message);
Label3.Text = "Mail sent Successfully";
can anyone help me out to resolve this error.