SMTP Error?
I got this error when i'm running an application that sends automated e-mail from our servers.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email protected]
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 24, 2009, 5:19 AM EDT
if it helps yo please check "Do you like this answer" :)
Two Reason can be there for that
Situation 1:
They are on an IP Address that is specified outside your allowed relay range.
Situation 2:
SMTP not authenticating
try to send mail with code like below
protected void btnSend_Click(object sender, EventArgs e) { SmtpClient client = new SmtpClient(); MailMessage message = new MailMessage(); client.Port = 587; client.Host = "smtp.gmail.com"; client.UseDefaultCredentials = true; client.Credentials = new System.Net.NetworkCredential(txtemail.Text ,txtpass.Text ); client.EnableSsl = true; try { MailAddress SendTo = new MailAddress(txtTo.Text); MailAddress SendFrom = new MailAddress(txtFrom.Text); message = new MailMessage(SendFrom, SendTo); message.Body = txtMessage.Text; message.Subject = txtSub.Text; client.Send(message); txtStatus.Text = "Your email has been sent"; Page.RegisterClientScriptBlock("Thanks!", "alert('Thanks! for using this tool.')"); } catch (Exception ex) { txtStatus.Text = ex.ToString(); } }if it helps yo please check "Do you like this answer" :)
Tamer KhalilRank #2,182 · 647 reputationPosted Oct 24, 2009, 5:38 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 24, 2009, 7:01 AM EDT
IIS 6
--------------------------
IIS 6 Manager > SMTP Server Virtual Server > Properties > Access > Relay tab. Add 127.0.0.1 and retest.
On IIS 7 Check
-------------------
start>>control panel>>administrative tools>>internet information services
adding features to server by Using "Add Features Wizard" you can add Simple Mail Transfer Protocol (SMTP) Server with IIS7
if it helps you please check "Do you like this answer"