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

  • SEARCH
  • Home
  • 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 6982871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:20:43+00:00 2026-05-27T18:20:43+00:00

I’ve been trying for days now to send mail from Grails application and unsuccessfully.

  • 0

I’ve been trying for days now to send mail from Grails application and unsuccessfully. I’m using:

  • grails 1.3.7
  • mail 1.0 plugin
  • spring-security-core 1.2.6 plugin
  • tomcat 7.0.23

Specifficaly I’m trying to send mail with Exchange from application deployed on Tomcat server trought port 25 with no authentication, no SSL.

I’ve tried to send message with telnet from the VMWare virtual machine on which the app is deployed and it got trough.

This is my class for sending mails:

public boolean sendMessage(String to, String msgSubject, String msgText) 
{
    String host = "mail.mydomain.com";
    String username = "myuser@mydomain.com"; // your authsmtp username
    String password = "mypassword" // your authsmtp password
    String from = "myuser@mydomain.com";

    Properties props = System.getProperties();
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.user", username);
    props.put("mail.smtp.password", password);
    props.put("mail.smtp.port", "25"); // thish is the port recommended by authsmtp
    props.put("mail.smtp.auth", "false");

    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));

    InternetAddress to_address = new InternetAddress(to);
    message.addRecipient(Message.RecipientType.TO, to_address);

    message.setSubject(msgSubject);
    message.setText(msgText);
    Transport transport = session.getTransport("smtp");
    transport.connect(host, username, password);
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    return true;
}

This is error stack trace:

javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:590)

at javax.mail.Service.connect(Service.java:291)

at javax.mail.Service.connect(Service.java:172)

at javax.mail.Service$connect.call(Unknown Source)

at org.helpdesk.MymailService.sendMessage(MymailService.groovy:37)

at org.helpdesk.MymailService$sendMessage.call(Unknown Source)

at org.helpdesk.RequestController$_closure13.doCall(RequestController.groovy:247)

at org.helpdesk.RequestController$_closure13.doCall(RequestController.groovy)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

I’ve read few dozen posts considering problems like this but I’ve still havent manage to solve the problem. Any help is appreciated.

*EDIT:*Is it possible that there are some problems sending mails using javaMail with Exchange server SMTP when there is no authentication?

  • 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-27T18:20:43+00:00Added an answer on May 27, 2026 at 6:20 pm

    If you’re trying to connect to your mail server without authentication, call the connect method that doesn’t take a username and password. If you pass it a username and password, it thinks you really want to authenticate, and since it can’t find an authentication mechanism that the server supports, it fails.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from

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.