0

I use the Java based CMS dotCMS and I want to use google as the smtp server. I used the config as described in the dotCMS docs: http://dotcms.com/docs/latest/mail-configuration.

My config looks like this:

    <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"
     />

When I call the $mailer.sendEmail method I get an error back:

"Unable to Send Message: 530 5.7.0 Must issue a STARTTLS command first. c7sm25357283wjb.19 - gsmtp".

I also tried port 587, but that did not help either.

Any idea what I am doing wrong? I'm using dotcms 2.5.6. running on debian 7.8 (wheezy)

2 Answers 2

2

You shouldn't need the socketFactory setting.

You also shouldn't need the port setting.

Try setting mail.smtp.ssl.enable=true. If that doesn't work, try setting mail.transport.protocol=smtps and change all the mail.smtp.* settings to mail.smtps.*.

The Gmail entry in the JavaMail FAQ might be useful.

If none of that works, post the JavaMail debug output.

Sign up to request clarification or add additional context in comments.

1 Comment

Hey Bill. Thanks for the tip. I'll test it out.
1

Do you have 2 factor authentication set up in google? I think this might prevent the authentication from happening.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.