0

I have a code for sending mail using SMTP settings in asp.net. That code is working well on live but when i am testing the same on localhost. It shows the error:

Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc.xyz.com

I know this is some configuration related error, but i don't know exactly what i need to change to test the same on localhost. I have defined these attributes for SMTP:

 smtp.Host = "abc.server.net";
 smtp.Port = 123; 
 smtp.EnableSsl = false;
 fromEmail="any email";
 password="password"

Any help would be appreciated.

Mogli
  • 1,972
  • 11
  • 34
  • 67

1 Answers1

0

You have to configure relay restrictions in the IIS admin. see this article

try this

  1. Open IIS Manager using Control Panel --> Administrative Tools.
  2. Open SMTP Virtual Server properties.
  3. On General tab, Set IP address of the Web server instead of "All Unassigned".
  4. In Access tab, click on Relay button, this will open Relay Restrictions dialog.
  5. In relay computers list, add the loopback IP address i.e 127.0.0.1 and IP address of the Web server, so that they can pass/relay emails through the SMTP server.

source : SO

Community
  • 1
  • 1
Zaki
  • 5,540
  • 7
  • 54
  • 91