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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:44:11+00:00 2026-05-10T23:44:11+00:00

I found several other questions on SO regarding the JavaMail API and sending mail

  • 0

I found several other questions on SO regarding the JavaMail API and sending mail through an SMTP server, but none of them discussed using TLS security. I’m trying to use JavaMail to send status updates to myself through my work SMTP mail server, but it requires TLS, and I can’t find any examples online of how to use JavaMail to access an SMTP server that requires TLS encryption. Can anyone help with this?

  • 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. 2026-05-10T23:44:11+00:00Added an answer on May 10, 2026 at 11:44 pm

    We actually have some notification code in our product that uses TLS to send mail if it is available.

    You will need to set the Java Mail properties. You only need the TLS one but you might need SSL if your SMTP server uses SSL.

    Properties props = new Properties(); props.put('mail.smtp.starttls.enable','true'); props.put('mail.smtp.auth', 'true');  // If you need to authenticate // Use the following if you need SSL props.put('mail.smtp.socketFactory.port', d_port); props.put('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory'); props.put('mail.smtp.socketFactory.fallback', 'false'); 

    You can then either pass this to a JavaMail Session or any other session instantiator like Session.getDefaultInstance(props).

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

Sidebar

Related Questions

I've read several questions regarding UAC and privilege elevation but I've not found a
After searching stackoverflow.com I found several questions asking how to remove duplicates, but none
I've found several other questions that deal with this topic, but I just can't
I've read several of the other questions on SO regarding Java profilers, but I
Found several other questions with this topic, but they were syntax errors of people
I have found several other questions here on S.O. (and the web in general)
I've found several questions that are sort of similar to mine, but not 100%.
There are several questions about text-diff libraries for Java on SO, but none about
I found several controlsets for that nice looking ribbons (DotNetBar, DivElements, ...), but all
I have found several questions asking about template typedefs in C++0x, which are resolved

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.