Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Mailbox unavailable.

Mailbox unavailable.

Scheduled Pinned Locked Moved ASP.NET
helpsysadmincsharpcombeta-testing
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    suveenmohan
    wrote on last edited by
    #1

    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

    E 1 Reply Last reply
    0
    • S suveenmohan

      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

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • E eyeseetee

        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

        S Offline
        S Offline
        suveenmohan
        wrote on last edited by
        #3

        Thanks Its working Regards SMK

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups