Email Configuration

Hi,

I’m using Cuba Platform 6.8 and I’m trying to send e-mails using SMTP server from Hostgator.

I tried the following params

cuba.email.fromAddress = myaccount@mydomain.com
cuba.email.smtpHost = mail.mydomain.com
cuba.email.smtpPort = 26
cuba.email.smtpAuthRequired = true
cuba.email.smtpUser = myaccount@mydomain.com
cuba.email.smtpPassword = *********
cuba.email.smtpStarttlsEnable = false
cuba.email.smtpSslEnabled = false

Then I tested using JMX Console, but no success.

Failed to close server connection after message sending; nested exception is

javax.mail.MessagingException: Exception reading response;
  nested exception is:
	java.net.SocketTimeoutException: Read timed out
	at com.haulmont.cuba.core.app.Emailer.persistAndSendEmail(Emailer.java:215)

If I do cuba.email.smtpAuthRequired = false, I get:

Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

I also tried with ports 25 and 587, with different combinations of the parameters: smtpAuthRequired, smtpStarttlsEnable and smtpSslEnabled.

Tried also with another SMTP server but got the same results

Any suggestion?

Thank you

Claudio

Hello @claudio.montenegro,

Try to use mail.smtp.localhost parameter with your hostname (probably FQDN) as a value (documentation). Found this at stackoverflow.

Hello Ivan,

I did a small java App to test the connection with the SMTP server. The app worked fine and debugging the connection I got:

EHLO clmc
250-gator3245.hostgator.com Hello clmc [187.255.242.90]
250-SIZE 52428800
250-8BITMIME

Following your suggestion I set the parameter mail.smtp.localhost, to do so I edited the file tomcat\bin\setenv.sh and added the following line:

CATALINA_OPTS=“$CATALINA_OPTS -Dmail.smtp.localhost=clmc”

But I still got the “Access denied - Invalid HELO name”.

I also changed the “clmc” to the IP, but with the same result.

Thank you,

Claudio

Hello Claudio,

I did not face this problem, so I just can suggest to try send FQDN instead of hostname, for instance: clmc.yourdomain.com instead of clmc.

Anyway, the best way is debugging it using IDE while sending email from JMX :slight_smile:
image

Regards,
Ivan