I have a Contact Us page that is not working. there is this error:
System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: From domain must match authenticated domain at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddress Collection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Pages_Public_Contact.btnSend_Click(Object sender, EventArgs e) in c:\Users\Vanguardo66\Documents\Visual Studio 2013\WebSites\TelerikWebSite2\Pages\Public\Contact.aspx.cs:line 27
and this is my code-behind:
if (Page.IsValid)
{
try
{
MailMessage mail = new MailMessage((Session["User"] == "Guest" ? txtFromUnknown.Text.Trim() : UserCheck.ReturnUserInfo(4)), "ops@gitamarine.com", "Visiting", txtText.Text.Trim());
SmtpClient smtp = new SmtpClient("mail.gitamarine.com");
smtp.EnableSsl = false;
smtp.Credentials = new System.Net.NetworkCredential("website@gitamarine.com", "*********");
smtp.Port = 2525;
smtp.Send(mail);
}
catch (Exception ex)
{
lblAlert.Text = "Error: " + ex.ToString();
}
}
So I tried this but no luck!!! how does it work? I don't know!!! any way I am new to this please help.