認証済みの http プロキシを介して、python で chilkat mailman API を使用してメールを送信しようとしています。Chilkat ドキュメントの指示にできる限り従いましたが、プロキシ サーバーに問題があります。このプロキシが、phantomjs スクリプトを使用して、指定されたポートと認証で機能することを確認しました。
import chilkat
# The mailman object is used for sending and receiving email.
mailman = chilkat.CkMailMan()
# set the http proxy
mailman.put_HttpProxyAuthMethod("LOGIN")
mailman.put_HttpProxyHostname("xxx.xxx.xxx.xxx")
mailman.put_HttpProxyPort(xxxxx)
mailman.put_HttpProxyUsername("xxxxx")
mailman.put_HttpProxyPassword("xxxxx")
# Set the SMTP server.
mailman.put_SmtpHost("smtp.live.com")
mailman.put_StartTLS(True)
mailman.put_SmtpPort(25)
# Set the SMTP login/password (if required)
mailman.put_SmtpUsername("xxxxxxx")
mailman.put_SmtpPassword("xxxxxxx")
# Create a new email object
email = chilkat.CkEmail()
email.put_Subject("This is a test")
email.put_Body("This is a test")
email.put_From("name@email.com")
email.AddTo("Chris Johnson","name@email.com")
# Call SendEmail to connect to the SMTP server via the HTTP proxy and send.
success = mailman.SendEmail(email)
if (success != True):
print(mailman.lastErrorText())
sys.exit()
プロキシを設定するセクションを取り出すと、メールは正常に送信されます。私が見逃している他の属性はありますか?