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 6064021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:14:04+00:00 2026-05-23T09:14:04+00:00

Using the following code: sendMail(From(Props.get(email)), Subject(Test Email), To(email@address), PlainMailBodyType(test email body)); And in Boot.scala:

  • 0

Using the following code:


sendMail(From(Props.get("email")), Subject("Test Email"), To("email@address"),
                   PlainMailBodyType("test email body"));

And in Boot.scala:


 System.setProperty("mail.smtp.starttls.enable","false");
    System.setProperty("mail.smtp.host", host)
    System.setProperty("mail.smtp.auth", "true")
    Mailer.authenticator = Full(new Authenticator {
        override def getPasswordAuthentication = new PasswordAuthentication(user, password)
      })

I get the following error:

2011-05-23 18:49:02,868 ERROR [pool-3-thread-4] n.l.u.MailerImpl [Logging.scala:239] Couldn’t send mail
java.lang.ClassCastException: gnu.mail.handler.TextPlain cannot be cast to javax.activation.DataContentHandler
at javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:596) ~[activation-1.1.jar:1.1]
at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:550) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:611) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.writeTo(DataHandler.java:315) ~[activation-1.1.jar:1.1]
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:261) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1321) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2074) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2042) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Transport.send(Transport.java:117) ~[mail-1.4.1.jar:1.4.1]
at net.liftweb.util.MailerImpl$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:176) ~[lift-util_2.8.1-2.3.jar:2.3]

This code works on one box and not on another. Any ideas?

  • 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-23T09:14:05+00:00Added an answer on May 23, 2026 at 9:14 am

    Alternative solution if you want to use the Jetty package that comes with your Linux distro.

    The problem only seems to occur with the GNU implementation of JavaMail. If you can use the Sun implementation instead, it works fine, or at least it did for me.

    Adding Sun’s javamail:
    I took activation-1.1.jar and mail-1.4.1.jar that sbt had placed under the lib_managed/ folder of my Lift project, and placed them under /usr/share/jetty/lib/ on the server.

    Removing GNU javamail:
    Unfortunately, commenting out the gnumail.jar from /etc/jetty/start.config wasn’t enough to get rid of gnumail. Jetty somehow still found the gnumail.jar and now mails just crashed in a different way. To get things to work smoothly I had to uninstall libgnumail-java and therefore also libjetty-extra which depends on it (I’m using Ubuntu). If you need libjetty-extra you’ll need a different way to ensure Jetty won’t see gnumail.jar.

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

Sidebar

Related Questions

I'm using the following code to send an email from my vb.net web application.
I have following code which successfully sent email using Gmail address. But when i
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I'm using following code but cannot return data from MySQL. This is the output:
I want to send an email with an attachment using the following code (Python
i am using following code in android to get IMEI number of phone TelephonyManager
I'm trying to send mail from my application server using the following code FILE
I am trying to send an email using c# using the following code. MailMessage
I'm using the following code to test the outputting of fatal errors to the

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.