我想使用Gmail的SMTP服务器smtp.gmail.com在Windows中使用C发送邮件。我能够连接到服务器的端口587,但是服务器回应说需要STARTTLS/TLS。是否有任何Windows API调用来启动TLS连接?使用Win API通过Gmail邮件服务器发送邮件
我应该甚至考虑用C编写这个应用程序还是使用Python?
编辑:有没有人能够通过使用Telnet连接到smtp.gmail.com发送邮件?我得到的是
220 mx.google.com ESMTP g4sm73428740wae.2
HELO hello
502 5.5.1 Unrecognized command. g4sm73428740wae.2
HELO hello.hello
250 mx.google.com at your service
MAIL FROM:[email protected]
530 5.7.0 Must issue a STARTTLS command first. g4sm73428740wae.2
STARTTLS
220 2.0.0 Ready to start TLS
MAIL FROM:[email protected]
和连接丢失
Pythons smtplib支持TLS开箱即用; http://docs.python.org/library/smtplib.html – 2010-07-20 10:00:11
是的Python中的smtplib工作得很好,但我发现我必须用C写这段代码,除非有一些方法可以用Python编写邮件功能,从我的C代码中调用它。 – Stormshadow 2010-07-21 09:02:30