2012-06-28 2 views
-1

C#을 사용하여 Yahoo 계정에서 메일을 검색하려고합니다. 내가 쓸 것을 할 OpenPop을 테스트하는 서버는 항상 사용자 자격 증명을 수락하지 않았습니다하지만 자격 증명 확인을 확신C#을 사용하여 Yahoo 이메일 세부 정보 검색

Pop3Client objClient = new Pop3Client(); 
objClient.Connect("pop.mail.yahoo.com", 995, true); 
objClient.Authenticate("username","pass",AuthenticationMethod.UsernameAndPassword); 
int msgCount = objClient.GetMessageCount(); 
MessageBox.Show(msgCount.ToString()); 

문제.

내 Gmail 계정으로 동일한 코드를 시도했는데 모든 일이 정상적으로 처리됩니다. 야후가 설정하지 않으려 고하는 것이 있습니까? 다음 코드

+1

_ "서버는 항상 사용자 자격 증명을 받아들이지 않았습니다."_ - 정확한 ** 오류 란 무엇입니까? – CodeCaster

+0

SSL을 추가해야 할 것 같습니다. – weismat

+0

서버가 사용자 자격 증명을 수락하지 않았습니다.이 메시지는 – user1369192

답변

0

보십시오 : 당신은 야후 메일 플러스 가입자가 될 필요가 이메일 프로그램을 통해 야후 메일에 액세스하기 위해

try 
{ 
    if (pop3Client.Connected) 
     pop3Client.Disconnect(); 

    pop3Client.Connect("pop.mail.yahoo.com", 995, true); 
    pop3Client.Authenticate("[email protected]", "yourpassword"); 
    int count = pop3Client.GetMessageCount(); 
} 
catch (InvalidLoginException) 
{ 
    //MessageBox.Show(this, "The server did not accept the user credentials!", "POP3 Server Authentication"); 
} 
catch (PopServerNotFoundException) 
{ 
    //MessageBox.Show(this, "The server could not be found", "POP3 Retrieval"); 
} 
catch (PopServerLockedException) 
{ 
    //MessageBox.Show(this, "The mailbox is locked. It might be in use or under maintenance. Are you connected elsewhere?", "POP3 Account Locked"); 
} 
catch (LoginDelayException) 
{ 
    //MessageBox.Show(this, "Login not allowed. Server enforces delay between logins. Have you connected recently?", "POP3 Account Login Delay"); 
} 
catch (Exception e) 
{ 
    //MessageBox.Show(this, "Error occurred retrieving mail. " + e.Message, "POP3 Retrieval"); 
} 
+0

이 waht 내가 썼습니다.하지만 해결책이 필요합니다. 솔루션을 경우 그것은 더 helful 있습니다. 나는 비판적인 상황에 처해있다. – user1369192

1

.

1. Sign in to Yahoo Mail. 
2. Move your cursor over the gear icon (Gear Icon) and select Mail Options. 
3. Select POP & Forwarding. 
- The "Access your Yahoo Mail elsewhere" option displays. 
4. Select the radio button next to Access Yahoo Mail via POP. 
5. Click Save.