Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:52:16+00:00 2026-05-15T01:52:16+00:00

I am trying to send mail through grails mail plugin. I configured according to

  • 0

I am trying to send mail through grails mail plugin. I configured according to the documentation, and also followed few blog posts (http://blog.lourish.com/2010/04/02/sending-asynchronous-html-email-in-grails-with-activemq-jms-and-gmail/). That post mention that the closure way of declaring the configuration overrides others, but not true. Anyway I tried both approach, but seems like the port is still use the smtp default one. I get the below exception.

exception: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: Connection refused: connect

Now, I wrote a small program directly using the java mail library, and I could send the mail with that. The configuration is shown below. tried additional config “mail.smtp.port”:”465″”, but no change.. used the parameters mentioned in the above blog post, result same

    grails {
   mail {
     host = "smtp.gmail.com"
     port = "465"  
     username = "mylogin@gmail.com"
     password = "mypwd"
     props = ["mail.smtp.auth":"true",
            // "mail.smtp.port":"465",
              "mail.smtp.socketFactory.port":"465",
              "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
              "mail.smtp.socketFactory.fallback":"false"]
   }
}

thanks in advance..

Update: It is not port or firewall config, as when I made a grails application from scratch, and tried with the same config, everything works. Also, asked in grails forum http://grails.1312388.n4.nabble.com/grails-mail-mailSender-does-not-have-config-values-td2237704.html#a2237704 . Hope get a lead to try.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:52:16+00:00Added an answer on May 15, 2026 at 1:52 am

    I think I solved the issue.. I had previously installed Nimble plugin, which also has a mail configuration injected into my application(NimbleConfig.groovy). It worked after I set the mail parameters as in my conf.groovy. I did not see that mailSender is initialized with the nimble config values, and only initialized once from my conf.groovy.. So, I am not sure about the reason, but it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to configure a dedicated server that runs ASP.NET to send mail through
I'm trying to use the code below to send messages via System.Net.Mail and am
I'm trying to send an e-mail from a module I'm writing, but I keep
I´m trying to send a image through tcp to a server, firts getting the
I am trying to send a request to an url like this http://mysite.dk/tværs?test=æ from
I'm trying to send an email in Java but when I read the body
I am trying to send my dynamically created silverlight 2 page/image to a an
I am trying to send an email from a site I am building, but
I'm trying to send the output to the console (or colouredconsole) ... which I'm
I'm trying to send email to Active Directory distribution groups. I know you can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.