• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
E-gineering

E-gineering

  • Who We Are
    • Our Story
    • Leadership Team
    • Whole Team
  • What We Do
    • Practices
    • Full Services
    • Success Stories
  • Working Here
    • Careers
    • Work Life
    • Community Life
    • Fun Life
  • Blog
  • Contact Us

JavaMail and Gmail Simplified Part 5: Epilogue

July 1, 2009 by Christian Desserich

Mail-01I know that this is way too long as it is, but in going through my folders I found a folder where I was keeping example code found out in cyberland and I wanted to share part of the code that seems to make it into a lot of example Gmail code out there. This shows where people are populating configuration properties for which there are no reasons. If the protocol is specified properly, all of the things listed here are unnecessary.


Properties props = new Properties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.host", "smtp.gmail.com");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
props.put("mail.smtp.quitwait", "false");

Session session = Session.getDefaultInstance(props, null);

 

Category: Enterprise

About Christian Desserich

Previous Post:JavaMail and Gmail Simplified Part 4: The Code, Sending and Receiving
Next Post:Asian Character Display in Eclipse

Let’s work together

Get in touch with us and send some basic info about your project.

Get in touch!

Social

Follow along on social media

  • Mail
  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Navigation

Home

Who We Are

What We Do

Working Here

Blog

Contact Us

Contact

8415 Allison Pointe Blvd
Suite 200
Indianapolis, IN 46250

317.348.1780

info@e-gineering.com

© Copyright 2023 | E-gineering, Inc.

Return to top