首页 > Windows开发 > 详细

C# Use Pop3Client to read gmail

时间:2015-09-26 14:31:26      阅读:338      评论:0      收藏:0      [点我收藏+]

host = "pop.gmail.com"

user = "xxxxx@gmail.com"

password = "xxxx"

port = 995

Pop3Client client = new Pop3Client();

client.connet(host, port, true);

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

int mailCount = client.GetMessageCount();

在執行authentication時出現exception, InvalidLoginException

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

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

 

C# Use Pop3Client to read gmail

原文:http://www.cnblogs.com/sipher/p/4840652.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!