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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:37:19+00:00 2026-06-17T09:37:19+00:00

I am a beginner of using Desktop.mail(URI) class, so I am looking for a

  • 0

I am a beginner of using Desktop.mail(URI) class, so I am looking for a way to add to, cc and subject to the mail when triggered from the program.

     String mailTo = "test@domain.com";
     String cc = "test2@domain.com";
     String subject = "firstEmail";
     String body = "the java message";

    URI uriMailTo = new URI(mailTo,cc,subject,body);
    Desktop desktop;
    desktop = Desktop.getDesktop();
    desktop.mail(uriMailTo);

can any one suggest any tutorials to learn this process, because I am looking for even more functions like receiving the data back from the outlook to the Java program.

Thanks in advance for help!

  • 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-17T09:37:20+00:00Added an answer on June 17, 2026 at 9:37 am

    The Desktop.mail() function is a utility method for launching whatever mail program may exist in the users system (if any). You have (very) limited capability of controlling the actual mail message to be (eventually) sent, and once the mail client is displayed you’re pretty much done – aka you wont be getting any feedback on what message was actually sent or wether it succeeded.

    If you need this level of control then you should be using the JavaMail API, which does a lot of what you seem to need.

    If you are stuck with using the Desktop mail client, then you might want to read up on RFC 2368. It describes all the fields that can be included in a mailto URI. So, you will be able to populate the message, but you won’t get feedback on wether it was successfully sent or not:

    mailto:joe@example.com?cc=bob@example.com&body=hello+world
    

    A code example of constructing your URI (which is incorrect btw):

    final String mailURIStr = String.format("mailto:%s?subject=%s&cc=%s&body=%s",
        mailTo, subject, cc, body);
    final URI mailURI = new URI(mailURIStr);
    

    Where the substituted should be URL encoded if necessary.

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

Sidebar

Related Questions

Is there an easy beginner way to take the current time using <ctime> to
I am a beginner at using openGL. I have used a program which I
Python beginner here. I am using the matplotlib library to make graphs from tab
Being a beginner of using Django, i am trying to add some module for
very beginner question. I am using Rails 3's query interface as shown: class User
String fileToBeRead = C:/Documents and Settings/Developer/Desktop/Anand exmps/Anand.xls; I have completed a java program in
I am a beginner in using autotool, I want to add some shell script
EDIT: The plugin in question is located here . PHP beginner here using a
I'm a RoR beginner and am using Rails 3.2.3. I have a search form
I am a beginner when it comes to using mysql queries embedded inside other

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.