3

I have my own smtp host. like, mail.xxx.com. and my application is host on Google Cloud Server. now when i send mail then it's give this type of error.

DEBUG SMTP: 

    useEhlo true, useAuth trueDEBUG SMTP: trying to connect to host "mail.xxx.com", port 587, isSSL falseorg.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: 
    Could not connect to SMTP host: mail.xxx.com, port: 587;  
    nested exception is:        java.net.ConnectException: Connection refused (Connection refused). 
    Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: mail.xxx.com, port: 587;

Mail Configuration Properties ::

mail.config.smtp.host=mail.xxx.com
mail.config.smtp.port=587
mail.config.smtp.username=noreply@xxx.com
mail.config.smtp.password=xxx
mail.config.smtp.auth=true
mail.config.smtp.starttls.enable=true

If anyone face this type of error and got the solution then please guide me.

Blugee
  • 61
  • 6
  • Possible duplicate of https://stackoverflow.com/q/8612437/1004631 – robot_alien Oct 10 '17 at 07:34
  • no, my question is not same or equal to that post.. because i am not used mail.gmail.com . gmail configuration is proper working but... another host like, mail.myservername.com is not working with google cloud – Blugee Oct 10 '17 at 07:40
  • Do you really have your own server? Or do you just have your own domain, hosted at Gmail? If the latter, you need to [connect to smtp.gmail.com](https://javaee.github.io/javamail/FAQ#gmail). This [Gmail help page](https://support.google.com/mail/answer/22370?hl=en) might also be useful. – Bill Shannon Oct 10 '17 at 19:10
  • yes, we have our own server with Hostgator for main domain and our subdomain is pointed to our application which is hosted on google cloud VM. – Blugee Oct 11 '17 at 14:24

0 Answers0