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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:22:18+00:00 2026-06-15T22:22:18+00:00

i am writing the junit for email application that sends mail to any external

  • 0

i am writing the junit for email application that sends mail to any external domains like gmail etc. I am using dumbster(Fake mail server) apis for
that which includes class like SmtpMessage,SmtpServer etc. i am writing the junit where i am sending the unicode body

   String unicodeBody = "TestBody\u0393"

But when i receive it from Fake mail server i get it like this “TestBody=CE=93”. Code for smtp server that receives the mail is

  SmtpMessage email=smtpServer.getReceivedEmail().next();

i am not sure what i am missing here?

just for information i send the mail as MimeMessage (whose content type is multipart/alternative) which internally
contains two mimeBodyParts i.e one for text body and another for html body.

EDIT:-
Complete email body is:-

MIME-Version: 1.0
Message-ID: <18805827.1.1355311147338.JavaMail.SMiles@INN-L-0019>
Subject: subject
Date: Wed, 12 Dec 2012 16:49:07 +0530 (IST)
To: to@email.com
Content-Type: multipart/alternative;
Reply-To: from@email.com
From: from@email.com

------=_Part_0_13986615.1355311147225Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: quoted-printable
body=CE=93------=_Part_0_13986615.1355311147225Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: quoted-printable
body=CE=93------=_Part_0_13986615.1355311147225--

------=_Part_0_13986615.1355311147225Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: quoted-printable
body=CE=93------=_Part_0_13986615.1355311147225Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: quoted-printable
body=CE=93------=_Part_0_13986615.1355311147225--
{MIME-Version=[1.0], Message-ID=[<18805827.1.1355311147338.JavaMail.Smiles@INN-L-0019>], Subject=[subject], Date=[Wed, 12 Dec 2012 16:49:07 +0530 (IST)], To=[to@email.com], Content-Type=[multipart/alternative;], Reply-To=[from@email.com], From=[from@email.com]}
  • 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-06-15T22:22:19+00:00Added an answer on June 15, 2026 at 10:22 pm

    That is called Quoted Printable encoding, and you can decode it with Apache Commons Codec for instance:

    public static void main(String[] args) {
        QuotedPrintableCodec a = new QuotedPrintableCodec("UTF-8");
        try {
            System.out.println(a.decode("TestBody=CE=93"));
            // prints "TestBodyΓ"
        } catch (DecoderException e) {
            e.printStackTrace();
        }
    }
    

    It will first turn =CE=93 into the actual byte values 0xCE 0x93, and then decode them as UTF-8 (Which was passed in the constructor)

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

Sidebar

Related Questions

I'm using Java 6, JUnit 4.8.1, and writing a console application. My application has
I'm writing JUnit tests for a service that creates and acts on an entity
I'm writing a JUnit test for some code that produces an Excel file (which
I'm writing a jUnit test for a constructor that parses a String and then
I'm writing a JUnit test using JUnitPerf. Here, I want to generate some entries
I'm writing some integrations tests in JUnit. What happens here is that when i
I'm writing an application in Java that will upload a file up to AWS
I'm writing a JUnit test method for a Clock class to ensure that the
I need to write JUnit tests for an old application that's poorly designed and
I'm writing unit tests for Spring Framework 2.5 using JUnit. More specifically, I'm using

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.