我想使用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