C# Use Pop3Client to read gmail

host = "pop.gmail.com"git

user = "xxxxx@gmail.com"github

password = "xxxx"app

port = 995less

Pop3Client client = new Pop3Client();this

client.connet(host, port, true);google

client.Authenticate(user, password, AuthenticationMethod.UsernameAndPassword);get

int mailCount = client.GetMessageCount();it

在執行authentication時出現exception, InvalidLoginExceptionio

解決方法參考 : https://github.com/foens/hpop/issues/39cli

1-enable the pop at Configurations / Forwarding and POP/IMAP
2- follow this link: https://www.google.com/settings/security/lesssecureappsand activate for less secure apps. (set [turn on])

相關文章
相關標籤/搜索