Mailbox unavailable.
-
Hi All, Here in my application I want to send Mail through my application, but when I click on send,got an error msg - "Send Email Failed. Mailbox unavailable. The server response was: 5.7.1 Unable to relay for suveen.kulshreshtha@yahoo.com " Plz help me to shortout that problem. here is the code protected void btnSendmail_Click(object sender, EventArgs e) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text); smtpClient.Host = "localhost"; smtpClient.Port = 25; message.From = fromAddress; message.To.Add("suveen.kulshreshtha@yahoo.com"); message.Subject = "Feedback"; message.IsBodyHtml = false; message.Body = txtMessage.Text; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpClient.UseDefaultCredentials = true; smtpClient.Send(message); lblStatus.Text = "Email successfully sent."; } catch (Exception ex) { lblStatus.Text = "Send Email Failed.;" + ex.Message; } } thanks SMK
-
Hi All, Here in my application I want to send Mail through my application, but when I click on send,got an error msg - "Send Email Failed. Mailbox unavailable. The server response was: 5.7.1 Unable to relay for suveen.kulshreshtha@yahoo.com " Plz help me to shortout that problem. here is the code protected void btnSendmail_Click(object sender, EventArgs e) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text); smtpClient.Host = "localhost"; smtpClient.Port = 25; message.From = fromAddress; message.To.Add("suveen.kulshreshtha@yahoo.com"); message.Subject = "Feedback"; message.IsBodyHtml = false; message.Body = txtMessage.Text; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpClient.UseDefaultCredentials = true; smtpClient.Send(message); lblStatus.Text = "Email successfully sent."; } catch (Exception ex) { lblStatus.Text = "Send Email Failed.;" + ex.Message; } } thanks SMK
MailMessage objMM = new MailMessage(); objMM.To = "email@y.com"; objMM.From = mailtxt.Text; objMM.Bcc = "a@b.com"; objMM.Cc = "b@b.com"; objMM.BodyFormat = MailFormat.Html; objMM.Priority = MailPriority.Normal; objMM.Subject = subjecttxt.Text; objMM.Body = "textbox1"; SmtpMail.Send(objMM); SmtpMail.SmtpServer = "localhost"; try something like that maybe also try http://codebetter.com/blogs/peter.van.ooijen/archive/2006/04/05/Using-localhost-as-mailserver-\_2800\_5.7.1-Unable-to-relay-for-xxx\_2900\_.aspx
-
MailMessage objMM = new MailMessage(); objMM.To = "email@y.com"; objMM.From = mailtxt.Text; objMM.Bcc = "a@b.com"; objMM.Cc = "b@b.com"; objMM.BodyFormat = MailFormat.Html; objMM.Priority = MailPriority.Normal; objMM.Subject = subjecttxt.Text; objMM.Body = "textbox1"; SmtpMail.Send(objMM); SmtpMail.SmtpServer = "localhost"; try something like that maybe also try http://codebetter.com/blogs/peter.van.ooijen/archive/2006/04/05/Using-localhost-as-mailserver-\_2800\_5.7.1-Unable-to-relay-for-xxx\_2900\_.aspx
Thanks Its working Regards SMK