我使用基於Java的CMS dotCMS,我想使用谷歌作爲smtp服務器。我使用了dotCMS文檔中描述的配置:http://dotcms.com/docs/latest/mail-configuration。STARTTLS問題當使用谷歌作爲smtp服務器時,使用javamail
我的配置是這樣的:
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.debug="true"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.gmail.com"
mail.smtp.auth="true"
mail.smtp.port="465"
mail.smtp.starttls.enable="true"
mail.smtp.user="[my username]"
mail.password="[my pwd]"
username="[my username]"
password="[my pwd]"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
當我打電話$mailer.sendEmail
方法我得到一個錯誤回來:
「無法發送消息:530 5.7.0必須首先發出STARTTLS命令。 c7sm25357283wjb.19 - gsmtp「。
我也嘗試過端口587
,但這也沒有幫助。
任何想法我做錯了什麼?我正在使用dotcms 2.5.6。在debian 7.8上運行(wheezy)
嘿比爾。謝謝你的提示。我會測試一下。 – koenpeters