如何使用 GMail 作为免费的 SMTP 服务器并克服验证码

问题描述:

GMail 可以用作 SMTP 服务器.我已经编写了执行此操作的代码.但众所周知,GMail 有时可能会使用验证码(图像验证,他们称之为)进行身份验证.同样的事情可能是拒绝SMTP认证的原因.

GMail can used as a SMTP server. I've written the code that does it. But as we all know GMail may occasionally authenticate using captcha (image verification as they call it). The same thing may be the cause to reject SMTP authentication.

正如我所见,当您第一次尝试从某台机器登录时,谷歌会显示图像验证.从同一台机器(到同一帐户)的所有连续登录都使用常规登录.我有点担心这个验证码也会因为其他一些我无法控制的原因再次出现.

As I've seen google shows image verification when you try to log-in for the first time from some machine. All consecutive log-ins from the same machine (to the same account) use regular login. I'm a bit afraid this captcha may also come up again for some other reasons that I can't control.

所以.在需要采取特殊措施的情况下,是否仍然可以进行身份​​验证?以及如何?

我还应该提到,通过网络浏览器从机器登录也可以启用程序化 SMTP 身份验证.

I should also mention that logging in from the machine via web browser also enables programmatic SMTP authentication.

Google 似乎并不是特别清楚是什么提示他们阻止用户的帐户,直到他成功输入了 验证码短语.但是,当 Google 发现与您的帐户相关的异常或可疑活动时,很可能会触发这种机制.因此,我预计他们不太可能提供退出保护他们和您的机制的选项,尽管欢迎其他人找到相反的证据.

Google doesn't seem to be particularly clear about what prompts them to block a user's account until he has successfully entered a captcha phrase. However, it's likely that this is a mechanism which is triggered when Google sees what it considers to be unusual or suspicious activity associated with your account. As a result, I would expect it to be unlikely that they will supply an option to opt out of a mechanism which is protecting both them and you, although others are welcome to find evidence to the contrary.

有关何时以及如何发生的各种讨论提出了一些您可能想尝试看看是否有帮助的建议,例如 选择更强的密码 或干脆更改密码.祝你好运!

Various discussions of when and how this happens throw up some suggestions which you might like to try to see if they help, such as choosing a stronger password or simply changing your password. Good luck!