2011-01-26 1 views
1

내 서버에서 호스팅되는받는 사람으로부터 보낸 SMTP 전자 메일을 보낼 수 없습니다. 나는 외부 전자 메일 주소로받는 사람으로부터받은 전자 메일에 대해 잘 작동하는 연락처 양식을 가지고 있지만 이제는 내 시스템 중 하나에서 동일한 서버에 호스팅 된 도메인의 전자 메일을 다른 제공된 전자 메일 (구독자)에게 보내야합니다. 오류 :내부 전자 메일 주소에서 SMTP를 통해 전자 메일 보내기 - 사서함을 사용할 수 없거나 로컬이 아닙니다 (.NET 4)

Error Sending Email: Mailbox unavailable. The server response was: Requested action not taken: mailbox unavailable or not local

나는 IIS7윈도우 서버mailEnable을 실행하고 사람이 문제가 된 경우 궁금 무엇입니까? Outlook을 통해 위의 세부 정보를 사용하여 사서함을 테스트했으며 전자 메일을 잘 보내고받습니다. 아래 코드 샘플은 내가 사용하고 있으며 인증까지 잘해야한다는 것을 보여줍니다. 또한 C# 코드로 다시 구성 설정을 이동하고 동일한 문제가있었습니다.

예제의 Web.config :

<system.net> 
    <mailSettings> 
     <smtp deliveryMethod="Network" from="[email protected]"> 
      <network defaultCredentials="true" host="mail.test.com" port="25" userName="[email protected]" password="******" /> 
     </smtp> 
    </mailSettings> 
</system.net> 

예 C# .NET을 4 코드 : MailEnable의 웹 사이트를 보면

try 
{ 
_emailMsg.Body = _MessageBody; 
_emailMsg.Priority = MailPriority.Normal; 

SmtpClient mSmtpClient = new SmtpClient(); 

mSmtpClient.UseDefaultCredentials = true; 

mSmtpClient.Send(_emailMsg); 
return true; 
} 
catch (Exception ex) 
{ 
throw new Exception("Error Sending Email: " + ex.Message); 

return false; 
} 
+0

당신이 이메일 수신자를 설정하는가? – codingbadger

+0

죄송합니다. 이전에 전자 메일 개체를 설정했지만 현재 로그인 한 사용자로 설정되어 있으며 디버깅 할 때 그 값이 있음을 보여줍니다. – Andrew

+1

코드에 문제가없는 것 같습니다. 수신자가 동일한 도메인에 있는지 확인하십시오. – codingbadger

답변

2

가 발생할 수있는 몇 가지 guidance on the error messages있다. 조금 더 추측

, 당신의 도메인 이름이 웹 서버에 존재하는 어떤 문제가 없다는 것을 나타납니다,하지만 당신은 명시 적으로 화이트리스트에 address-map.tab 파일 이메일 주소를 가지고있다. 이 더 노트는 문제에있는 전체에서의 해상도는 다음과 같습니다

The resolution here really resolves around when you think this error is being returned when it should not be. If the address is thought to exist on the server then you need to check the SMTP logs activity for the transaction and then the debug to see if there are any error descriptions that better explain what happened when the address was sent to. Then you should check your configuration to ensure that the address does exist. It can also be a good idea to check the address-map.tab file in the MailEnable\Config directory or relevant database table for a line that contains the mailbox name in question. If you are checking why the sender could not relay through the server then you should at this time check the client settings and ensure that the outbound settings in the client are configured as such so they can relay through the server to non local email addresses.

+0

사용중인 자격 증명과 조합 된 조합입니다 (기본값이 사용되고 있었어 야했습니다). – Andrew

1

사용이 :

try { 
    _emailMsg.Body = _MessageBody; 
    _emailMsg.Priority = MailPriority.Normal; 

    SmtpClient mSmtpClient = new SmtpClient(server,25); 
    mSmtpClient.Send(_emailMsg); 
    return true; 
} catch (Exception ex) { 
    throw new Exception("Error Sending Email: " + ex.Message); 
    return false; 
} 
+3

Welcome To Stack Overflow! 코드 블록을 게시하는 것보다이 코드가 문제를 해결하는 이유를 설명하십시오. 설명이 없으면 이것은 대답이 아닙니다. –