<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>JavaRoots</title><description>Java And Open Source !!</description><managingEditor>noreply@blogger.com (Unknown)</managingEditor><pubDate>Wed, 20 May 2026 03:29:21 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">159</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://www.javaroots.com/</link><language>en-us</language><item><title>Ad : 123passportphoto</title><link>http://www.javaroots.com/2026/05/ad-123passportphoto.html</link><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 20 May 2026 03:29:21 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5509067075365699345</guid><description>Just made my passport photos at home in 5 minutes – super easy!I needed passport photos for my Australia trip and didn't want to pay $15+ at a photo shop. Tried 123PassportPhoto.com and it worked perfectly.Upload your photo → crop it → it makes the correct size with white background. You can download and print on normal 4x6" photo paper. Saved me time and money.Highly recommend if you're in Australia or need photos for any country.
&lt;a href="123passportphoto" target="_blank"&gt; https://www.123passportphoto.com&lt;/a&gt;/Has anyone else tried this?

</description></item><item><title>Dataweave 2.0 date calculation</title><link>http://www.javaroots.com/2020/01/dataweave-20-date-calculation.html</link><category>Dataweave</category><category>MULE 4</category><category>MULE ESB</category><author>noreply@blogger.com (Unknown)</author><pubDate>Wed, 15 Jan 2020 19:06:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-1846014387375912337</guid><description>If you want to add number of days from a date and calculate a new date, you can use following code to do so. please note that in this case number of days are variable and calculated runtime. 

&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;set-variable variableName=&amp;quot;date&amp;quot; value=&amp;quot;#[output application/java var days = vars.inputDays --- (now() - (&amp;apos;P$(days)D&amp;apos; as Period)) as Date {&amp;apos;format&amp;apos; : &amp;apos;ddMMyyyy&amp;apos;}]&amp;quot; /&amp;gt;
&lt;/pre&gt;

Following code can help you to calculate new date after subtracting number of months. 
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;set-variable variableName=&amp;quot;date&amp;quot; value=&amp;quot;#[output application/java var days = vars.inputDays --- (now() - (&amp;apos;P$(days)D&amp;apos; as Period)) as Date {&amp;apos;format&amp;apos; : &amp;apos;ddMMyyyy&amp;apos;}]&amp;quot; /&amp;gt;
&lt;/pre&gt;


Following code can help you to calculate new date after subtracting number of years. 
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;set-variable variableName=&amp;quot;date&amp;quot; value=&amp;quot;#[output application/java var years = vars.inputYears --- (now() - (&amp;apos;P$(years)Y&amp;apos; as Period)) as Date {&amp;apos;format&amp;apos; : &amp;apos;ddMMyyyy&amp;apos;}]&amp;quot; /&amp;gt;
&lt;/pre&gt;

Following code can decompose date in multiple parts 
&lt;pre class="prettyprint lang-java"&gt;
%dw 2.0
output application/json
var myDate = |2003-10-01T23:57:59.700-03:00|
---
{
  year: myDate.year,
  month: myDate.month,
  day: myDate.day,
  hour: myDate.hour,
  minutes: myDate.minutes,
  seconds: myDate.seconds,
  milliseconds: myDate.milliseconds,
  nanoseconds: myDate.nanoseconds,
  quarter: myDate.quarter,
  dayOfWeek: myDate.dayOfWeek,
  dayOfYear: myDate.dayOfYear,
  offsetSeconds: myDate.offsetSeconds
}
&lt;/pre&gt;

For more information please check &lt;a href="https://docs.mulesoft.com/mule-runtime/4.2/dataweave-types" target="_blank"&gt;mulesoft documentation&lt;/a&gt;


</description></item><item><title>How to Send emails in Java</title><link>http://www.javaroots.com/2019/11/how-to-send-emails-in-java.html</link><category>CORE JAVA</category><category>JAVA 8</category><author>noreply@blogger.com (Unknown)</author><pubDate>Wed, 20 Nov 2019 16:20:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-6184183332837219984</guid><description>&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;Today we will discuss how to send emails from your Java app. In general, you have two main options: either use the native built-in functionality, or try some external packages. Java provides a quite comprehensive email package. Let’s start with learning how to use it and then have a quick look at other available options (there are not that many of them, indeed).&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;What is JavaMail:&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;JavaMail is an official Java API for sending and receiving emails. Starting from July 2019, JavaMail is known as Jakarta Mail. Oracle transferred the rights for Java EE to the Eclipse Foundation, and now the software evolves under the Jakarta EE brand. The official documentation for Jakarta Mail API can be now found here.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&amp;nbsp;In fact, only the project name changed with the Jakarta Mail release. Let’s see how to install it first. The mail package is already included in Jakarta EE and the Java EE platforms.
To download the latest version, go to the Jakarta Mail Implementation page on GitHub. You will need jakarta.mail.jar file: insert it in your CLASSPATH environment then. Alternatively, you can add it with Maven dependencies as follows: 
&lt;/span&gt;&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;    &amp;lt;dependencies&amp;gt;
            &amp;lt;dependency&amp;gt;
                &amp;lt;groupId&amp;gt;com.sun.mail&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;jakarta.mail&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.6.4&amp;lt;/version&amp;gt;
            &amp;lt;/dependency&amp;gt;
        &amp;lt;/dependencies&amp;gt;

&lt;/span&gt;&lt;/pre&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;The mail system in Java is built with classes provided by Jakarta Mail API. You will find the detailed descriptions in the official documentation, while in this tutorial we will refer to the main points , which allow us to:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;add email headers&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;create plain text and HTML messages&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;embed images&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;attach files&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;send messages via SMTP using password authentication 

&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;How to build a simple email &lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;
&lt;span id="docs-internal-guid-e4d2c6dc-7fff-fde9-09ab-ffacb0cd71fc"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;To create a simple mail, we need to import the necessary classes:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"&gt;javax.mail.Message&lt;/span&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt; - an abstract class, creates a message&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span id="docs-internal-guid-abe550f2-7fff-7be8-2e8e-1a99f377e28b" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"&gt;javax.mail.internet.MimeMessage &lt;/span&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;- its sub-class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-a166fa31-7fff-9cfa-b352-6ce24b0c2378" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"&gt;javax.mail.MessagingException &lt;/span&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;- notifies about possible errors&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b&gt;javax.mail.PasswordAuthentication&lt;/b&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt; - requires password authentication for an SMTP server&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span id="docs-internal-guid-035b3aa5-7fff-0da1-8dce-a4003af97bae" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"&gt;javax.mail.Session &lt;/span&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;- joins all the properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-bbc0e958-7fff-2feb-a1e6-c02d3629280d" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"&gt;javax.mail.Transport - &lt;/span&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;sends message&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-b83d65d0-7fff-4909-179d-2f17a39eae45" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"&gt;javax.mail.internet.InternetAddress&lt;/span&gt;&lt;span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt; - to add email addresses&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span id="docs-internal-guid-621b17a0-7fff-64f9-90f4-5f520da34557" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; white-space: pre-wrap;"&gt;Then we need to specify the sending server in properties and set message parameters as follows:&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;package&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; com&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;example&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;smtp&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; java&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;util&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b id="docs-internal-guid-ae99fce2-7fff-d1f9-5918-01eeb41a60d9" style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MessagingException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Transport&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;internet&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;internet&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MimeMessage&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;public&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;class&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;SendEmail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;public&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;static&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;void&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;main&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;[]&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; args&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;)&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Put recipient’s address&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;to&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"test@example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Put sender’s address&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; from &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"from@example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;final&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; username &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"username@example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;final&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; password &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"yourpassword"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Paste host address&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; host &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"smtp.example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; props &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.auth"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"true"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.starttls.enable"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"true"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.host"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; host&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.port"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"2525"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// use the port appropriate for your host&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Get the Session object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; session &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;getInstance&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Authenticator&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;()&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;protected&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;getPasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;()&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;return&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;username&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; password&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;try&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Create a default MimeMessage object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; message &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MimeMessage&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Set From: header field&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setFrom&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;from&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Set To: header field&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setRecipients&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;RecipientType&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;TO&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;parse&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;to&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Set Subject: header field&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setSubject&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"How to send a simple email in Java"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Put the content of your message&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setText&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"Hi there, this is my first message sent in Java"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Send message&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Transport&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;send&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;System&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;out&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;println&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"Sent message successfully...."&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;b style="font-weight: normal;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;catch&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MessagingException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; e&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;)&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;throw&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;RuntimeException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;e&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span id="docs-internal-guid-722c1d4f-7fff-6701-d1bb-3785a5cb0cfa"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;Here is how this message should look in your test email inbox:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFcK3dmNRWT3y7KsL5bUOFbwujKJQlM8Fya0bnrwgw0DJhCv6vusxif4i6F7l0fXU42UiQyeM8uwEPRWMx_43piNrVJ2W1kbO100As_U21_VHmdjKR-7B_U0nD5EN-53QQvT6yxgvFmAo/s1600/Image+1+%2528Java+article%2529.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;img border="0" data-original-height="721" data-original-width="1082" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFcK3dmNRWT3y7KsL5bUOFbwujKJQlM8Fya0bnrwgw0DJhCv6vusxif4i6F7l0fXU42UiQyeM8uwEPRWMx_43piNrVJ2W1kbO100As_U21_VHmdjKR-7B_U0nD5EN-53QQvT6yxgvFmAo/s320/Image+1+%2528Java+article%2529.png" width="320" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span id="docs-internal-guid-b7760389-7fff-07fa-556b-2fda15d48295" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;Let’s add HTML Content:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span id="docs-internal-guid-57e0bc49-7fff-8977-af9e-647bad99194f"&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;To build a simple template with text formatting, links, or images, we will use HTML. For this purpose, we will use &lt;/span&gt;&lt;span style="font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"&gt;SendHTMLEmail&lt;/span&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt; class (unlike SendEmail for a simple message in our previous example) and set &lt;/span&gt;&lt;span style="font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"&gt;MimeMessage.setContent&lt;/span&gt;&lt;span style="font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"&gt;(Object, String)&lt;/span&gt;&lt;span style="font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;package&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; com&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;example&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;smtp&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; java&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;util&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b id="docs-internal-guid-97fc99b4-7fff-bde4-3771-b8f94eefbae7" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MessagingException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Transport&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;internet&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;import&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;internet&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MimeMessage&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;public&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;class&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;SendHTMLEmail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;public&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;static&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;void&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;main&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;[&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;]&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; args&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;)&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;to&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"johndoe@example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; from &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"yourmail@example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;final&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; username &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"yourusername"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;final&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; password &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"yourpassword"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;String&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; host &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"smtp.example.com"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; props &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Properties&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.auth"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"true"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.starttls.enable"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"true"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.host"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; host&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;put&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"mail.smtp.port"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"2525"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Get the Session object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; session &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;getInstance&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;props&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; javax&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;mail&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Authenticator&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;()&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;protected&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;getPasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;()&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;return&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;PasswordAuthentication&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;username&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; password&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;try&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Create a default MimeMessage object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; message &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #9a6e3a; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;=&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MimeMessage&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;session&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setFrom&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;from&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setRecipients&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;RecipientType&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;TO&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;InternetAddress&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;parse&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;to&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setSubject&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"newHTML message"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp; &amp;nbsp; message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;setContent&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"&amp;lt;h1&amp;gt;This is header&amp;lt;/h1&amp;gt;"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"text/html"&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: slategrey; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;// Send message&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;Transport&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;send&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;message&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;System&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;out&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;println&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #669900; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;"Sent message successfully...."&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;catch&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;MessagingException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; e&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;)&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &amp;nbsp; e&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;.&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;printStackTrace&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;throw&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #0077aa; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;new&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt; &lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #dd4a68; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;RuntimeException&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;(&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;e&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f5f2f0; color: black; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-eff45c2b-7fff-e0ee-e4ed-04472ae620ae"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;Here is how the result should look in your test email service:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLsKIIfNfa6SSLssGVJ0-TvpUvaK1fNMHasBOp9ULoK_W-8DNRHpOVTtZgL_7_OajGsqBpTSYGY4wW7HB8ybhZ_2PQuUmRpczqyJHPmuNO0Yr_Z-vMGKdUx_7lHA554-16vcV1VmBFbVw/s1600/Image+2+%2528Java+article%2529.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;img border="0" data-original-height="725" data-original-width="1135" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLsKIIfNfa6SSLssGVJ0-TvpUvaK1fNMHasBOp9ULoK_W-8DNRHpOVTtZgL_7_OajGsqBpTSYGY4wW7HB8ybhZ_2PQuUmRpczqyJHPmuNO0Yr_Z-vMGKdUx_7lHA554-16vcV1VmBFbVw/s320/Image+2+%2528Java+article%2529.png" width="320" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 16pt; white-space: pre;"&gt;How to attach files : &lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341"&gt;&lt;span style="background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 11pt; vertical-align: baseline;"&gt;You can attach files with the attachFile method specified in the MimeBodyPart as follows:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="color: #0077aa; font-size: 10pt; vertical-align: baseline;"&gt;public&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #0077aa; font-size: 10pt; vertical-align: baseline;"&gt;void&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;attachFile&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;File&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; file&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;Multipart&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; multipart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;MimeBodyPart&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; messageBodyPart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="color: #dd4a68; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;DataSource&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt; source &lt;/span&gt;&lt;span style="color: #9a6e3a; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #0077aa; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;new&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;FileDataSource&lt;/span&gt;&lt;span style="font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;file&lt;/span&gt;&lt;span style="font-size: 10pt; text-indent: 36pt; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;messageBodyPart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;setDataHandler&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: #0077aa; font-size: 10pt; vertical-align: baseline;"&gt;new&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;DataHandler&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;source&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 10pt; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; text-decoration-line: none; white-space: pre;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div dir="ltr" style="font-size: 10pt; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt; text-decoration-line: none; white-space: pre;"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;messageBodyPart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;setFileName&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;file&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;getName&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341"&gt;
&lt;span style="background-color: #f5f2f0; color: #999999; font-family: arial, helvetica, sans-serif; font-size: 10pt; font-style: normal; font-weight: 400; white-space: pre;"&gt;
&lt;/span&gt;&lt;div dir="ltr" style="background-color: #f5f2f0; color: #999999; font-family: arial, helvetica, sans-serif; font-size: 10pt; font-style: normal; font-weight: 400; line-height: 1.332; margin-bottom: 0pt; margin-top: 0pt; white-space: pre;"&gt;
&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;multipart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span style="color: #dd4a68; font-size: 10pt; vertical-align: baseline;"&gt;addBodyPart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt;messageBodyPart&lt;/span&gt;&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span style="color: black; font-size: 10pt; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;span style="font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/h4&gt;
&lt;/div&gt;
&lt;h4 style="background-color: #f5f2f0; color: #999999; font-family: arial, helvetica, sans-serif; line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span id="docs-internal-guid-454da160-7fff-e21e-3059-5c8664c2ee61" style="font-weight: normal;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;Other ways to send emails in Java:&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;div style="font-family: arial, helvetica, sans-serif; line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span id="docs-internal-guid-c13e475b-7fff-3b0c-cea6-518f4b145a67"&gt;&lt;span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;Above, we have gone through the main capabilities of the native Java email functionality. What other options can you consider? &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span style="font-size: 14.6667px; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-family: Arial;"&gt;The most popular alternatives are:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="vertical-align: baseline;"&gt;&lt;span id="docs-internal-guid-0ab71960-7fff-b165-d38f-0518274bc341" style="font-family: Arial;"&gt;&lt;div style="line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span style="font-size: 14.6667px; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;add email headers &lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span style="font-size: 14.6667px; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Apache Common Emails &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style="line-height: 1.368; margin-bottom: 8pt; margin-top: 8pt;"&gt;
&lt;span style="font-size: 14.6667px; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Simple Java Mail library&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;

&lt;/span&gt;&lt;span style="background-color: #f5f2f0; color: #999999; font-size: 10pt; font-style: normal; font-weight: 400; white-space: pre;"&gt;
&lt;/span&gt;&lt;/span&gt;
It is worth mentioning that all of them are built on top of the JavaMail API. 
This article on sending emails in Java was originally published on the &lt;a href="https://blog.mailtrap.io/sending-email-using-java/"&gt;Mailtrap blog.&lt;/a&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFcK3dmNRWT3y7KsL5bUOFbwujKJQlM8Fya0bnrwgw0DJhCv6vusxif4i6F7l0fXU42UiQyeM8uwEPRWMx_43piNrVJ2W1kbO100As_U21_VHmdjKR-7B_U0nD5EN-53QQvT6yxgvFmAo/s72-c/Image+1+%2528Java+article%2529.png" width="72"/></item><item><title>ForEach vs Splitter in mule</title><link>http://www.javaroots.com/2019/11/foreach-vs-splitter-in-mule.html</link><category>Mule 3</category><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Tue, 19 Nov 2019 16:28:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-121710329765419423</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

This example app will show the difference between Foreach and splitter in Mule version 3.x. Collection splitter splits the incoming collection object and then you have to put a aggregator to collect the resultant objects. For each scope is a scope which does not change the payload and you get the same collection object once for each loop completes. 
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;

&amp;lt;mule xmlns:vm=&amp;quot;http://www.mulesoft.org/schema/mule/vm&amp;quot; xmlns:http=&amp;quot;http://www.mulesoft.org/schema/mule/http&amp;quot; xmlns=&amp;quot;http://www.mulesoft.org/schema/mule/core&amp;quot; xmlns:doc=&amp;quot;http://www.mulesoft.org/schema/mule/documentation&amp;quot;
 xmlns:spring=&amp;quot;http://www.springframework.org/schema/beans&amp;quot; 
 xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
 xsi:schemaLocation=&amp;quot;http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd&amp;quot;&amp;gt;
    &amp;lt;http:listener-config name=&amp;quot;HTTP_Listener_Configuration&amp;quot; host=&amp;quot;0.0.0.0&amp;quot; port=&amp;quot;8081&amp;quot; doc:name=&amp;quot;HTTP Listener Configuration&amp;quot;/&amp;gt;
    &amp;lt;flow name=&amp;quot;foreachtestFlow&amp;quot;&amp;gt;
        &amp;lt;http:listener config-ref=&amp;quot;HTTP_Listener_Configuration&amp;quot; path=&amp;quot;/test&amp;quot; allowedMethods=&amp;quot;GET&amp;quot; doc:name=&amp;quot;HTTP&amp;quot;/&amp;gt;
        &amp;lt;component class=&amp;quot;foreachexample.CollectionPayloadComponent&amp;quot; doc:name=&amp;quot;Java&amp;quot;/&amp;gt;
        &amp;lt;!-- &amp;lt;foreach doc:name=&amp;quot;For Each&amp;quot;&amp;gt;
         &amp;lt;choice doc:name=&amp;quot;Choice&amp;quot;&amp;gt;
         &amp;lt;when expression=&amp;quot;#[payload == &amp;apos;foreach&amp;apos;]&amp;quot;&amp;gt;
          &amp;lt;set-session-variable value=&amp;quot;foreachVar&amp;quot; variableName=&amp;quot;test&amp;quot; doc:name=&amp;quot;Session Variable&amp;quot;&amp;gt;&amp;lt;/set-session-variable&amp;gt;
         &amp;lt;/when&amp;gt;
         &amp;lt;otherwise&amp;gt;
          &amp;lt;set-session-variable value=&amp;quot;BBQVar&amp;quot; variableName=&amp;quot;test&amp;quot; doc:name=&amp;quot;Session Variable&amp;quot;&amp;gt;&amp;lt;/set-session-variable&amp;gt;
         &amp;lt;/otherwise&amp;gt;
        &amp;lt;/choice&amp;gt;
         &amp;lt;flow-ref name=&amp;quot;flow3&amp;quot; doc:name=&amp;quot;Flow Reference&amp;quot;/&amp;gt;
        &amp;lt;/foreach&amp;gt; --&amp;gt;
        &amp;lt;collection-splitter /&amp;gt;
        &amp;lt;logger message=&amp;quot;payload is : #[payload]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
        &amp;lt;choice&amp;gt;
         &amp;lt;when expression=&amp;quot;#[payload == &amp;apos;foreach&amp;apos;]&amp;quot;&amp;gt;
          &amp;lt;set-session-variable value=&amp;quot;foreachVar&amp;quot; variableName=&amp;quot;test&amp;quot;&amp;gt;&amp;lt;/set-session-variable&amp;gt;
         &amp;lt;/when&amp;gt;
         &amp;lt;otherwise&amp;gt; 
          &amp;lt;set-session-variable value=&amp;quot;BBQVar&amp;quot; variableName=&amp;quot;test&amp;quot;&amp;gt;&amp;lt;/set-session-variable&amp;gt;
         &amp;lt;/otherwise&amp;gt;
        &amp;lt;/choice&amp;gt; 
        &amp;lt;flow-ref name=&amp;quot;flow3&amp;quot; /&amp;gt;
   &amp;lt;set-payload value=&amp;quot;dsadasd&amp;quot;/&amp;gt;        
    &amp;lt;/flow&amp;gt;
    
    &amp;lt;flow name=&amp;quot;flow2&amp;quot;&amp;gt;
        &amp;lt;vm:inbound-endpoint path=&amp;quot;foreach&amp;quot; doc:name=&amp;quot;VM&amp;quot;/&amp;gt;
        &amp;lt;logger message=&amp;quot; session var value is #[sessionVars.test] and payload is #[payload]&amp;quot; level=&amp;quot;ERROR&amp;quot; doc:name=&amp;quot;Logger&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;

 &amp;lt;flow name=&amp;quot;flow3&amp;quot;&amp;gt;
        &amp;lt;vm:outbound-endpoint path=&amp;quot;foreach&amp;quot; doc:name=&amp;quot;VM&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;
    
&amp;lt;/mule&amp;gt;
&lt;/pre&gt;

Post your comments and suggestions. 


&lt;br /&gt;&lt;/div&gt;
</description></item><item><title>Integrate CloudWatch Logs with Cloudhub Mule </title><link>http://www.javaroots.com/2017/10/integrate-cloudwatch-logs-with-cloudhub.html</link><category>AWS</category><category>CLOUDHUB</category><category>CloudWAtch</category><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Thu, 12 Oct 2017 20:38:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-1227736564497228767</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

In this blog, i will explain how to enable &lt;a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html"&gt;AWS Cloudwatch Logs&lt;/a&gt; for your Mule CloudHub Application. Cloudwatch Logs Services are provided by AWS so that you can better mange your logs. It is relatively cheaper than splunk. Since cloudhub automatically rolls over logs more than 100 MB, we require a mechanism to manage our logs more efficiently. For this, we create this Custom appender which will send the logs to cloudwatch.

&lt;pre class="prettyprint lang-java"&gt;

package com.javaroots.appenders;

import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList;

import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
import org.apache.logging.log4j.status.StatusLogger;

import com.amazonaws.regions.Regions;
import com.amazonaws.services.logs.AWSLogs;
import com.amazonaws.services.logs.model.CreateLogGroupRequest;
import com.amazonaws.services.logs.model.CreateLogStreamRequest;
import com.amazonaws.services.logs.model.CreateLogStreamResult;
import com.amazonaws.services.logs.model.DataAlreadyAcceptedException;
import com.amazonaws.services.logs.model.DescribeLogGroupsRequest;
import com.amazonaws.services.logs.model.DescribeLogStreamsRequest;
import com.amazonaws.services.logs.model.InputLogEvent;
import com.amazonaws.services.logs.model.InvalidSequenceTokenException;
import com.amazonaws.services.logs.model.LogGroup;
import com.amazonaws.services.logs.model.LogStream;
import com.amazonaws.services.logs.model.PutLogEventsRequest;
import com.amazonaws.services.logs.model.PutLogEventsResult;

@Plugin(name = "CLOUDW", category = "Core", elementType = "appender", printObject = true)
public class CloudwatchAppender extends AbstractAppender {
 
 /**
  * 
  */
 private static final long serialVersionUID = 12321345L;
 
 private static Logger logger2 = LogManager.getLogger(CloudwatchAppender.class);

 private final Boolean DEBUG_MODE = System.getProperty("log4j.debug") != null;

    /**
     * Used to make sure that on close() our daemon thread isn't also trying to sendMessage()s
     */
    private Object sendMessagesLock = new Object();

    /**
     * The queue used to buffer log entries
     */
    private LinkedBlockingQueue&lt;LogEvent&gt; loggingEventsQueue;

    /**
     * the AWS Cloudwatch Logs API client
     */
    private AWSLogs awsLogsClient;

    private AtomicReference&lt;String&gt; lastSequenceToken = new AtomicReference&lt;&gt;();

    /**
     * The AWS Cloudwatch Log group name
     */
    private String logGroupName;

    /**
     * The AWS Cloudwatch Log stream name
     */
    private String logStreamName;

    /**
     * The queue / buffer size
     */
    private int queueLength = 1024;

    /**
     * The maximum number of log entries to send in one go to the AWS Cloudwatch Log service
     */
    private int messagesBatchSize = 128;

    private AtomicBoolean cloudwatchAppenderInitialised = new AtomicBoolean(false);
 

    private CloudwatchAppender(final String name,
                           final Layout&lt;? extends Serializable&gt; layout,
                           final Filter filter,
                           final boolean ignoreExceptions,String logGroupName, 
                           String logStreamName,
                           Integer queueLength,
                           Integer messagesBatchSize) {
        super(name, filter, layout, ignoreExceptions);
        this.logGroupName = logGroupName;
        this.logStreamName = logStreamName;
        this.queueLength = queueLength;
        this.messagesBatchSize = messagesBatchSize;
        this.activateOptions();
    }

    @Override
    public void append(LogEvent event) {
      if (cloudwatchAppenderInitialised.get()) {
             loggingEventsQueue.offer(event);
         } else {
             // just do nothing
         }
    }
    
    public void activateOptions() {
        if (isBlank(logGroupName) || isBlank(logStreamName)) {
            logger2.error("Could not initialise CloudwatchAppender because either or both LogGroupName(" + logGroupName + ") and LogStreamName(" + logStreamName + ") are null or empty");
            this.stop();
        } else {
          //below lines work with aws version 1.9.40 for local build
          //this.awsLogsClient = new AWSLogsClient();
          //awsLogsClient.setRegion(Region.getRegion(Regions.AP_SOUTHEAST_2));
          this.awsLogsClient = com.amazonaws.services.logs.AWSLogsClientBuilder.standard().withRegion(Regions.AP_SOUTHEAST_2).build();
            loggingEventsQueue = new LinkedBlockingQueue&lt;&gt;(queueLength);
            try {
                initializeCloudwatchResources();
                initCloudwatchDaemon();
                cloudwatchAppenderInitialised.set(true);
            } catch (Exception e) {
                logger2.error("Could not initialise Cloudwatch Logs for LogGroupName: " + logGroupName + " and LogStreamName: " + logStreamName, e);
                if (DEBUG_MODE) {
                    System.err.println("Could not initialise Cloudwatch Logs for LogGroupName: " + logGroupName + " and LogStreamName: " + logStreamName);
                    e.printStackTrace();
                }
            }
        }
    }
    
    private void initCloudwatchDaemon() {
     Thread t = new Thread(() -&gt; {
            while (true) {
                try {
                    if (loggingEventsQueue.size() &gt; 0) {
                        sendMessages();
                    }
                    Thread.currentThread().sleep(20L);
                } catch (InterruptedException e) {
                    if (DEBUG_MODE) {
                        e.printStackTrace();
                    }
                }
            }
        });
     t.setName("CloudwatchThread");
     t.setDaemon(true);
     t.start();
    }
    
    private void sendMessages() {
        synchronized (sendMessagesLock) {
            LogEvent polledLoggingEvent;
            final Layout&lt;? extends Serializable&gt; layout = getLayout();
            List&lt;LogEvent&gt; loggingEvents = new ArrayList&lt;&gt;();

            try {

                while ((polledLoggingEvent = loggingEventsQueue.poll()) != null &amp;&amp; loggingEvents.size() &lt;= messagesBatchSize) {
                    loggingEvents.add(polledLoggingEvent);
                }
                List&lt;InputLogEvent&gt; inputLogEvents = loggingEvents.stream()
                        .map(loggingEvent -&gt; new InputLogEvent().withTimestamp(loggingEvent.getTimeMillis())
                          .withMessage
                          (
                            layout == null ?
                            loggingEvent.getMessage().getFormattedMessage():
                            new String(layout.toByteArray(loggingEvent), StandardCharsets.UTF_8)
                            )
                          )
                        .sorted(comparing(InputLogEvent::getTimestamp))
                        .collect(toList());

                if (!inputLogEvents.isEmpty()) {

                    PutLogEventsRequest putLogEventsRequest = new PutLogEventsRequest(
                            logGroupName,
                            logStreamName,
                            inputLogEvents);

                    try {
                        putLogEventsRequest.setSequenceToken(lastSequenceToken.get());
                        PutLogEventsResult result = awsLogsClient.putLogEvents(putLogEventsRequest);
                        lastSequenceToken.set(result.getNextSequenceToken());
                    } catch (DataAlreadyAcceptedException dataAlreadyAcceptedExcepted) {
                     
                        putLogEventsRequest.setSequenceToken(dataAlreadyAcceptedExcepted.getExpectedSequenceToken());
                        PutLogEventsResult result = awsLogsClient.putLogEvents(putLogEventsRequest);
                        lastSequenceToken.set(result.getNextSequenceToken());
                        if (DEBUG_MODE) {
                            dataAlreadyAcceptedExcepted.printStackTrace();
                        }
                    } catch (InvalidSequenceTokenException invalidSequenceTokenException) {
                        putLogEventsRequest.setSequenceToken(invalidSequenceTokenException.getExpectedSequenceToken());
                        PutLogEventsResult result = awsLogsClient.putLogEvents(putLogEventsRequest);
                        lastSequenceToken.set(result.getNextSequenceToken());
                        if (DEBUG_MODE) {
                            invalidSequenceTokenException.printStackTrace();
                        }
                    }
                }
            } catch (Exception e) {
                if (DEBUG_MODE) {
                 logger2.error(" error inserting cloudwatch:",e);
                    e.printStackTrace();
                }
            }
        }
    }

    private void initializeCloudwatchResources() {

        DescribeLogGroupsRequest describeLogGroupsRequest = new DescribeLogGroupsRequest();
        describeLogGroupsRequest.setLogGroupNamePrefix(logGroupName);

        Optional&lt;LogGroup&gt; logGroupOptional = awsLogsClient
                .describeLogGroups(describeLogGroupsRequest)
                .getLogGroups()
                .stream()
                .filter(logGroup -&gt; logGroup.getLogGroupName().equals(logGroupName))
                .findFirst();

        if (!logGroupOptional.isPresent()) {
            CreateLogGroupRequest createLogGroupRequest = new CreateLogGroupRequest().withLogGroupName(logGroupName);
            awsLogsClient.createLogGroup(createLogGroupRequest);
        }

        DescribeLogStreamsRequest describeLogStreamsRequest = new DescribeLogStreamsRequest().withLogGroupName(logGroupName).withLogStreamNamePrefix(logStreamName);

        Optional&lt;LogStream&gt; logStreamOptional = awsLogsClient
                .describeLogStreams(describeLogStreamsRequest)
                .getLogStreams()
                .stream()
                .filter(logStream -&gt; logStream.getLogStreamName().equals(logStreamName))
                .findFirst();
        if (!logStreamOptional.isPresent()) {
            CreateLogStreamRequest createLogStreamRequest = new CreateLogStreamRequest().withLogGroupName(logGroupName).withLogStreamName(logStreamName);
            CreateLogStreamResult o = awsLogsClient.createLogStream(createLogStreamRequest);
        }

    }
    
    private boolean isBlank(String string) {
        return null == string || string.trim().length() == 0;
    }
    protected String getSimpleStacktraceAsString(final Throwable thrown) {
        final StringBuilder stackTraceBuilder = new StringBuilder();
        for (StackTraceElement stackTraceElement : thrown.getStackTrace()) {
            new Formatter(stackTraceBuilder).format("%s.%s(%s:%d)%n",
                    stackTraceElement.getClassName(),
                    stackTraceElement.getMethodName(),
                    stackTraceElement.getFileName(),
                    stackTraceElement.getLineNumber());
        }
        return stackTraceBuilder.toString();
    }

    @Override
    public void start() {
        super.start();
    }

    @Override
    public void stop() {
        super.stop();
        while (loggingEventsQueue != null &amp;&amp; !loggingEventsQueue.isEmpty()) {
            this.sendMessages();
        }
    }

    @Override
    public String toString() {
        return CloudwatchAppender.class.getSimpleName() + "{"
                + "name=" + getName() + " loggroupName=" + logGroupName
                +" logstreamName=" + logStreamName;
               
    }

    @PluginFactory
    @SuppressWarnings("unused")
    public static CloudwatchAppender createCloudWatchAppender(
      @PluginAttribute(value = "queueLength" ) Integer queueLength,
                                                  @PluginElement("Layout") Layout&lt;? extends Serializable&gt; layout,
                                                  @PluginAttribute(value = "logGroupName") String logGroupName,
                                                  @PluginAttribute(value = "logStreamName") String logStreamName,
                                                  @PluginAttribute(value = "name") String name,
                                                  @PluginAttribute(value = "ignoreExceptions", defaultBoolean = false) Boolean ignoreExceptions,
                                                  
                                                  @PluginAttribute(value = "messagesBatchSize") Integer messagesBatchSize)
    {
     return new CloudwatchAppender(name, layout, null, ignoreExceptions, logGroupName, logStreamName ,queueLength,messagesBatchSize);
    }
}

&lt;/pre&gt;

We add the dependency in our pom.xml file.
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;com.amazonaws&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;aws-java-sdk-logs&amp;lt;/artifactId&amp;gt;
   &amp;lt;!-- for local 3.8.5 we need to use this version cloudhub 3.8.5 has jackson 2.6.6 --&amp;gt;
   &amp;lt;!-- &amp;lt;version&amp;gt;1.9.40&amp;lt;/version&amp;gt; --&amp;gt;
   &amp;lt;version&amp;gt;1.11.105&amp;lt;/version&amp;gt;
   &amp;lt;exclusions&amp;gt;
    &amp;lt;exclusion&amp;gt;  &amp;lt;!-- declare the exclusion here --&amp;gt;
     &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;gt;
     &amp;lt;artifactId&amp;gt;log4j-1.2-api&amp;lt;/artifactId&amp;gt;
    &amp;lt;/exclusion&amp;gt;
    &amp;lt;exclusion&amp;gt;  &amp;lt;!-- declare the exclusion here --&amp;gt;
     &amp;lt;groupId&amp;gt;com.fasterxml.jackson.core&amp;lt;/groupId&amp;gt;
     &amp;lt;artifactId&amp;gt;jackson-core&amp;lt;/artifactId&amp;gt;
    &amp;lt;/exclusion&amp;gt;
    &amp;lt;exclusion&amp;gt;  &amp;lt;!-- declare the exclusion here --&amp;gt;
     &amp;lt;groupId&amp;gt;com.fasterxml.jackson.core&amp;lt;/groupId&amp;gt;
     &amp;lt;artifactId&amp;gt;jackson-databind&amp;lt;/artifactId&amp;gt;
    &amp;lt;/exclusion&amp;gt;
   &amp;lt;/exclusions&amp;gt;
  &amp;lt;/dependency&amp;gt;
  &amp;lt;!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api --&amp;gt;
  &amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;log4j-api&amp;lt;/artifactId&amp;gt;
   &amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;
  &amp;lt;/dependency&amp;gt;
  &amp;lt;!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core --&amp;gt;
  &amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;log4j-core&amp;lt;/artifactId&amp;gt;
   &amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;
  &amp;lt;/dependency&amp;gt;
&lt;/pre&gt;
Now we need to modify our log4j2.xml. add out custom cloudwatch appender and CloudhubLogs appender as well so that we get the logs on cloudhub as well.
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;Configuration status=&amp;quot;trace&amp;quot; packages=&amp;quot;au.edu.vu.appenders,com.mulesoft.ch.logging.appender&amp;quot;&amp;gt;

 &amp;lt;!--These are some of the loggers you can enable. 
     There are several more you can find in the documentation. 
        Besides this log4j configuration, you can also use Java VM environment variables
        to enable other logs like network (-Djavax.net.debug=ssl or all) and 
        Garbage Collector (-XX:+PrintGC). These will be append to the console, so you will 
        see them in the mule_ee.log file. --&amp;gt;


    &amp;lt;Appenders&amp;gt;
         &amp;lt;CLOUDW name=&amp;quot;CloudW&amp;quot; logGroupName=&amp;quot;test-log-stream&amp;quot; 
        logStreamName=&amp;quot;test44&amp;quot; messagesBatchSize=&amp;quot;${sys:cloudwatch.msg.batch.size}&amp;quot; queueLength=&amp;quot;${sys:cloudwatch.queue.length}&amp;quot;&amp;gt;
   &amp;lt;PatternLayout pattern=&amp;quot;%d [%t] %-5p %c - %m%n&amp;quot;/&amp;gt;
  &amp;lt;/CLOUDW&amp;gt;
  
  &amp;lt;Log4J2CloudhubLogAppender name=&amp;quot;CLOUDHUB&amp;quot;
                                   addressProvider=&amp;quot;com.mulesoft.ch.logging.DefaultAggregatorAddressProvider&amp;quot;
                                   applicationContext=&amp;quot;com.mulesoft.ch.logging.DefaultApplicationContext&amp;quot;
                                   appendRetryIntervalMs=&amp;quot;${sys:logging.appendRetryInterval}&amp;quot;
                                   appendMaxAttempts=&amp;quot;${sys:logging.appendMaxAttempts}&amp;quot;
                                   batchSendIntervalMs=&amp;quot;${sys:logging.batchSendInterval}&amp;quot;
                                   batchMaxRecords=&amp;quot;${sys:logging.batchMaxRecords}&amp;quot;
                                   memBufferMaxSize=&amp;quot;${sys:logging.memBufferMaxSize}&amp;quot;
                                   journalMaxWriteBatchSize=&amp;quot;${sys:logging.journalMaxBatchSize}&amp;quot;
                                   journalMaxFileSize=&amp;quot;${sys:logging.journalMaxFileSize}&amp;quot;
                                   clientMaxPacketSize=&amp;quot;${sys:logging.clientMaxPacketSize}&amp;quot;
                                   clientConnectTimeoutMs=&amp;quot;${sys:logging.clientConnectTimeout}&amp;quot;
                                   clientSocketTimeoutMs=&amp;quot;${sys:logging.clientSocketTimeout}&amp;quot;
                                   serverAddressPollIntervalMs=&amp;quot;${sys:logging.serverAddressPollInterval}&amp;quot;
                                   serverHeartbeatSendIntervalMs=&amp;quot;${sys:logging.serverHeartbeatSendIntervalMs}&amp;quot;
                                   statisticsPrintIntervalMs=&amp;quot;${sys:logging.statisticsPrintIntervalMs}&amp;quot;&amp;gt;

            &amp;lt;PatternLayout pattern=&amp;quot;[%d{MM-dd HH:mm:ss}] %-5p %c{1} [%t] CUSTOM: %m%n&amp;quot;/&amp;gt;
        &amp;lt;/Log4J2CloudhubLogAppender&amp;gt;
        
    &amp;lt;/Appenders&amp;gt;
    &amp;lt;Loggers&amp;gt;
     
     
  &amp;lt;!-- Http Logger shows wire traffic on DEBUG --&amp;gt;
  &amp;lt;AsyncLogger name=&amp;quot;org.mule.module.http.internal.HttpMessageLogger&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;
 
  &amp;lt;!-- JDBC Logger shows queries and parameters values on DEBUG --&amp;gt;
  &amp;lt;AsyncLogger name=&amp;quot;com.mulesoft.mule.transport.jdbc&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;
    
        &amp;lt;!-- CXF is used heavily by Mule for web services --&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;org.apache.cxf&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;

        &amp;lt;!-- Apache Commons tend to make a lot of noise which can clutter the log--&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;org.apache&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;

        &amp;lt;!-- Reduce startup noise --&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;org.springframework.beans.factory&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;

        &amp;lt;!-- Mule classes --&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;org.mule&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;com.mulesoft&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt;

        &amp;lt;!-- Reduce DM verbosity --&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;org.jetel&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;
        &amp;lt;AsyncLogger name=&amp;quot;Tracking&amp;quot; level=&amp;quot;WARN&amp;quot;/&amp;gt;
        
        &amp;lt;AsyncRoot level=&amp;quot;INFO&amp;quot;&amp;gt;
            &amp;lt;AppenderRef ref=&amp;quot;CLOUDHUB&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt;
            &amp;lt;AppenderRef ref=&amp;quot;CloudW&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt;
        &amp;lt;/AsyncRoot&amp;gt;
    &amp;lt;/Loggers&amp;gt;
&amp;lt;/Configuration&amp;gt;
&lt;/pre&gt;
Finally we need to disable cloudhub logs on cloudhub run time manager. &lt;/br&gt;&lt;/br&gt;

This is working with cloudhub mule runtime version 3.8.4. some issue with cloudhub 3.8.5 version, where it is getting initilized properly, and sending logs, but events and messages are missing.&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

&lt;br /&gt;&lt;/div&gt;
</description></item><item><title>How to Set Up dedicated load balancer on Cloudhub</title><link>http://www.javaroots.com/2017/09/how-to-set-up-dedicated-load-balancer-cloudhub.html</link><category>CLOUDHUB</category><category>LoadBalancer</category><category>Mule Enterprise</category><category>MULE ESB</category><category>VPC</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Tue, 26 Sep 2017 20:07:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-4407101017215988507</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
MuleSoft cloudhub provides inbuilt loadbalancer in the form of &lt;b&gt;{appname}.cloudhub.io&lt;/b&gt;, which forwards the request on &lt;b&gt;mule-worker-{appname}.au.cloudhub.io:8081&lt;/b&gt;, if we are using http port. &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;
When you deploy your application on cloudhub, the app http listener always listens on port 8081 for http and 8082 for https. &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

This is a step by step guide to set up dedicated loadbalancer on cloudhub.&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

For creating a dedicated load balancer, first go to load balancer tab and click on create load balancer button.&lt;/br&gt;&lt;/br&gt;

Now put the load balancer name and select the target VPC, the VPC which you have created for your cloudhub.&lt;/br&gt;&lt;/br&gt;

Select inbound http mode to redirect so that calls coming as http will automatically redirected to https.&lt;/br&gt;&lt;/br&gt;

Add your certicates and pem files on the next page.&lt;/br&gt;&lt;/br&gt;

now load balancer is created with a default rule. 

&lt;pre class="prettyprint lang-java"&gt;

│ Index │ Input URI                    │ App Name                     │ App URI                      │ Upstream Protocol            │
├───────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 0     │ /{app}/                      │ {app}                        │ /                            │ http                         │
└───────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
&lt;/pre&gt;
&lt;/br&gt;
it means your load balancer URL which is like this : &lt;b&gt;https://{load-balancer}-dlb.lb.anypointdns.net/{app}&lt;/b&gt; will be forwarded to &lt;b&gt;mule-worker-{appname}.au.cloudhub.io:8091&lt;/b&gt;&lt;/br&gt;

Please note that in case of inbuilt load balancer, the request is forwarded to mule-worker-{appname}.au.cloudhub.io:8081,but in case of a dedicated load balancer 
it is forwarded to &lt;b&gt;mule-worker-{appname}.au.cloudhub.io:8091&lt;/b&gt;&lt;/br&gt;&lt;/br&gt;

now since we have configured our app to listen to {http.port}, it always listens to port 8081. and dedicated load balancer url will always result in 502 error like this.&lt;/br&gt;&lt;/br&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDo4udM2TMqzfSwRVEeIhPSZP25kUVpXowy6wJ9OR_COLRVylNBXy6teDg277kCxs2xCZoEDPQrl_jrq9DYkj14lhQpTscE57lpSZb39M5xqtx7Dk8yjm1fyHjeUGsRxQ2tg2cUwVReg_G/s1600/502errorcloudhubdlb.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDo4udM2TMqzfSwRVEeIhPSZP25kUVpXowy6wJ9OR_COLRVylNBXy6teDg277kCxs2xCZoEDPQrl_jrq9DYkj14lhQpTscE57lpSZb39M5xqtx7Dk8yjm1fyHjeUGsRxQ2tg2cUwVReg_G/s320/502errorcloudhubdlb.png" width="315" height="320" data-original-width="1577" data-original-height="1600" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;


so, we need to change our app to listen to port 8091. I have tried changing the port by adding the property to cloud hub, but it does not work.&lt;/br&gt;&lt;/br&gt;

You have to change your application to listen to {http.private.port} like this in order to make your dedicated load balancer work:

&lt;pre class="prettyprint lang-java"&gt;

&amp;lt;http:listener-config name=&amp;quot;HTTP_Listener_Configuration&amp;quot;  host=&amp;quot;0.0.0.0&amp;quot; port=&amp;quot;${http.private.port}&amp;quot; doc:name=&amp;quot;HTTP Listener Configuration&amp;quot;/&amp;gt;
&lt;/pre&gt;

Once you do that, dedicated load balancer url will work correctly.


&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDo4udM2TMqzfSwRVEeIhPSZP25kUVpXowy6wJ9OR_COLRVylNBXy6teDg277kCxs2xCZoEDPQrl_jrq9DYkj14lhQpTscE57lpSZb39M5xqtx7Dk8yjm1fyHjeUGsRxQ2tg2cUwVReg_G/s72-c/502errorcloudhubdlb.png" width="72"/></item><item><title>How to Call Another Flow From Dataweave</title><link>http://www.javaroots.com/2017/09/how-to-call-another-flow-from-dataweave.html</link><category>Dataweave</category><category>Mule Enterprise</category><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Sun, 3 Sep 2017 22:52:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-1626582794214312031</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is a simple example showing how to call another flow and include that result in the resultant xml file. The opertaion "lookup" should be used in dataweave. &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;

&amp;lt;mule xmlns:http=&amp;quot;http://www.mulesoft.org/schema/mule/http&amp;quot; xmlns:vm=&amp;quot;http://www.mulesoft.org/schema/mule/vm&amp;quot; xmlns:metadata=&amp;quot;http://www.mulesoft.org/schema/mule/metadata&amp;quot; xmlns:dw=&amp;quot;http://www.mulesoft.org/schema/mule/ee/dw&amp;quot; xmlns=&amp;quot;http://www.mulesoft.org/schema/mule/core&amp;quot; xmlns:doc=&amp;quot;http://www.mulesoft.org/schema/mule/documentation&amp;quot;
 xmlns:spring=&amp;quot;http://www.springframework.org/schema/beans&amp;quot; 
 xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
 xsi:schemaLocation=&amp;quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd&amp;quot;&amp;gt;
    &amp;lt;http:listener-config name=&amp;quot;HTTP_Listener_Configuration&amp;quot; host=&amp;quot;0.0.0.0&amp;quot; port=&amp;quot;8081&amp;quot; doc:name=&amp;quot;HTTP Listener Configuration&amp;quot;/&amp;gt;
    &amp;lt;flow name=&amp;quot;dataweaveexampleFlow&amp;quot;&amp;gt;
        &amp;lt;!-- &amp;lt;http:listener config-ref=&amp;quot;HTTP_Listener_Configuration&amp;quot; path=&amp;quot;/ab&amp;quot; doc:name=&amp;quot;HTTP&amp;quot;/&amp;gt; --&amp;gt;
        &amp;lt;poll doc:name=&amp;quot;Poll&amp;quot;&amp;gt;
            &amp;lt;fixed-frequency-scheduler frequency=&amp;quot;1000&amp;quot; /&amp;gt;
            &amp;lt;expression-component doc:name=&amp;quot;Expression&amp;quot;&amp;gt;
             &amp;lt;![CDATA[
     dataweaveexample.User u1 = new dataweaveexample.User();
     u1.setName(&amp;quot;DataWeave&amp;quot;);
     u1.setEmail(&amp;quot;contact@javaroots.com&amp;quot;);
     u1.setRate(148.3385);
     dataweaveexample.User u2 = new dataweaveexample.User();
     u2.setName(&amp;quot;Example&amp;quot;);
     u2.setEmail(&amp;quot;contact@javaroots.com&amp;quot;);
     u2.setRate(28.3385);
     List list = new java.util.ArrayList();
     list.add(u1);
     list.add(u2);
     payload =  list;
   ]]&amp;gt;
            &amp;lt;/expression-component&amp;gt; 
        &amp;lt;/poll&amp;gt;
         &amp;lt;logger level=&amp;quot;INFO&amp;quot; message=&amp;quot;payload is :#[payload]&amp;quot; doc:name=&amp;quot;Logger&amp;quot;/&amp;gt;
         &amp;lt;dw:transform-message doc:name=&amp;quot;Transform Message&amp;quot;&amp;gt;
         &amp;lt;dw:input-payload mimeType=&amp;quot;application/java&amp;quot;/&amp;gt;
            &amp;lt;dw:set-payload&amp;gt;&amp;lt;![CDATA[%dw 1.0
%output application/xml
---
{
  users:{(payload map {
   user:{
    name:$.name,
    email:$.email,
    count:$$+1,
    rate: $.rate as :string {format :&amp;quot;###,00&amp;quot;},
    flowValue:lookup(&amp;quot;callFromAnotherFlow&amp;quot;,$)
   }  
  })   
  }
}]]&amp;gt;&amp;lt;/dw:set-payload&amp;gt;
&amp;lt;/dw:transform-message&amp;gt;
        &amp;lt;logger level=&amp;quot;INFO&amp;quot; message=&amp;quot;payload lodis is :#[payload]&amp;quot; doc:name=&amp;quot;Logger&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;
    &amp;lt;flow name=&amp;quot;callFromAnotherFlow&amp;quot;&amp;gt;
        &amp;lt;set-payload value=&amp;quot;Javaroots.com Mule ESB DataWeave Example&amp;quot; doc:name=&amp;quot;Set Payload&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;
&amp;lt;/mule&amp;gt;
&lt;/pre&gt;

Post Comments and Suggestions !!!&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;
&lt;br /&gt;&lt;/div&gt;
</description></item><item><title>Domain not available error Cloudhub Redeployment Issue</title><link>http://www.javaroots.com/2017/08/domain-not-available-error-cloudhub-mule-maven.html</link><category>CLOUDHUB</category><category>MAVEN</category><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Tue, 1 Aug 2017 21:44:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5238841757147392991</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
While deploying an application which was deployed successfully to Cloudhub previously using maven, I got the following error :

&lt;pre class="prettyprint lang-java"&gt;
[INFO] Deploying application MyApp-dev to Cloudhub
[ERROR] Domain MyApp-dev is not available. Aborting.
[ERROR] Failed to deploy MyApp-dev: Domain MyApp-dev is not available. Aborting.
org.mule.tools.maven.plugin.mule.DeploymentException: Domain MyApp-dev is not available. Aborting.
                at org.mule.tools.maven.plugin.mule.cloudhub.CloudhubDeployer.deploy(CloudhubDeployer.java:89)
                at org.mule.tools.maven.plugin.mule.DeployMojo.deployWithDeployer(DeployMojo.java:216)
                at org.mule.tools.maven.plugin.mule.DeployMojo.cloudhub(DeployMojo.java:193)
                at org.mule.tools.maven.plugin.mule.DeployMojo.doExecute(DeployMojo.java:179)
                at org.mule.tools.maven.plugin.mule.AbstractMuleMojo.execute(AbstractMuleMojo.java:176)
                at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
                at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
                at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
                at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
                at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
                at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
                at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

&lt;/pre&gt;
This error comes only when the application already exists in Cloudhub. Ideally, it should just update the existing application in Cloudhub.&lt;/br&gt;

To rectify this error, you need to make sure that your application name in your pom file contains only lower case letters, because of a possible &lt;a href="https://github.com/mulesoft/mule-maven-plugin/issues/64" target="_blank"&gt;bug&lt;/a&gt;.
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;applicationName&amp;gt;MyApp-${cloudHubAppSuffix}&amp;lt;/applicationName&amp;gt;
&lt;/pre&gt;
So, the application name should be changed to :
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;applicationName&amp;gt;myapp-${cloudHubAppSuffix}&amp;lt;/applicationName&amp;gt;
&lt;/pre&gt;

Post Comments And Suggestions !!!


&lt;br /&gt;&lt;/div&gt;
</description></item><item><title>How to read and write XL Files in Java</title><link>http://www.javaroots.com/2017/07/how-to-read-and-write-xl-files-in-java.html</link><category>CORE JAVA</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 19 Jul 2017 19:12:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-7111200783245924926</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Below Examples shows how to write and read XLSX and XLS files using Java . 

&lt;pre class="prettyprint lang-java"&gt;
package com.sun;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;


/**
 * Created with IntelliJ IDEA.
 * User: javaroots
 * Date: 10/21/13
 * Time: 11:46 AM
 * To change this template use File | Settings | File Templates.
 */
public class XLSReader {

    public static void main(String[] args) throws IOException 
    {
        XSSFWorkbook workbook = new XSSFWorkbook();
     XSSFSheet sheet = workbook.createSheet("Employee Data");
        
        //This data needs to be written (Object[])
        Map&lt;String, Object[]&gt; data = new TreeMap&lt;String, Object[]&gt;();
        data.put("1", new Object[] {"ID", "NAME", "LASTNAME"});
        data.put("2", new Object[] {1, "Amit", "Shukla"});
        data.put("3", new Object[] {2, "Lokesh", "Gupta"});
        data.put("4", new Object[] {3, "John", "Adwards"});
        data.put("5", new Object[] {4, "Brian", "Schultz"});
        
        
        
        //Iterate over data and write to sheet
        Set&lt;String&gt; keyset = data.keySet();
        int rownum = 0;
        for (String key : keyset)
        {
            Row row = sheet.createRow(rownum++);
            Object [] objArr = data.get(key);
            int cellnum = 0;
            for (Object obj : objArr)
            {
               Cell cell = row.createCell(cellnum++);
               if(obj instanceof String)
                    cell.setCellValue((String)obj);
                else if(obj instanceof Integer)
                    cell.setCellValue((Integer)obj);
            }
        }
        try
        {
           //Write the workbook in file system
            FileOutputStream out = new FileOutputStream(new File("C://xlFileMoreThan65000Test.xlsx"));
            
            workbook.write(out);
            out.close();
         
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        
        
    }
}



&lt;/pre&gt;
&lt;pre class="prettyprint lang-java"&gt;
package com.sun;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;


/**
 * Created with IntelliJ IDEA.
 * User: javaroots
 * Date: 10/21/13
 * Time: 11:46 AM
 * To change this template use File | Settings | File Templates.
 */
public class XLSReader {

    public static void main(String[] args) throws IOException 
    {
       
        try
        {
           
            long startTime = System.currentTimeMillis();
            for(int i =0 ;i&lt;10 ;i++)
            {
             FileInputStream in = new FileInputStream(new File("C://xlFileMoreThan65000Test.xlsx"));
                
              OPCPackage pkg = OPCPackage.open("C://xlFileMoreThan65000Test.xlsx");
             
             
             
                XSSFWorkbook workbook1 = new XSSFWorkbook(pkg);
                XSSFSheet sheet1 = workbook1.getSheetAt(0);
                int newRow = sheet1.getLastRowNum();
                System.out.println("last row is : " + newRow);
                for(int j=0;j &lt;1000 ;j++)
                {
                 newRow = newRow + 1 ;
                    
                    Row row = sheet1.createRow(newRow);
                    
                    Object [] objArr = data.get("2");
                    
                    int cellnum = 0;
                    for (Object obj : objArr)
                    {
                     Cell cell = row.createCell(cellnum++);
                        cell.setCellValue("abc");
                    }
                }
                FileOutputStream out = new FileOutputStream(new File("C://xlFileMoreThan65000Test.xlsx"));
                workbook1.write(out);
                out.close();
                in.close();
                pkg.close();
            }
            
            System.out.println("Time taken is " + (System.currentTimeMillis()-startTime));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        
        
    }
}

&lt;/pre&gt;
Post Comments And Suggestions !!!

&lt;br /&gt;&lt;/div&gt;</description></item><item><title>How to enable DEBUG Logging In CloudHub</title><link>http://www.javaroots.com/2017/07/how-to-enable-debug-logging-in-cloudhub.html</link><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 12 Jul 2017 19:44:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-8040981445703346788</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

cloudHub ignores the local log4j.xml configuration and even if we enable DEBUG logging in the xml file , and deploy it in cloudhub , we see no changes .&lt;/br&gt;&lt;/br&gt; To enable logging in cloud hub , we can add following configurations in out log4j .xml &lt;/br&gt;

&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;Log4J2CloudhubLogAppender name=&amp;quot;CLOUDHUB&amp;quot;
                                   addressProvider=&amp;quot;com.mulesoft.ch.logging.DefaultAggregatorAddressProvider&amp;quot;
                                   applicationContext=&amp;quot;com.mulesoft.ch.logging.DefaultApplicationContext&amp;quot;
                                   appendRetryIntervalMs=&amp;quot;${sys:logging.appendRetryInterval}&amp;quot;
                                   appendMaxAttempts=&amp;quot;${sys:logging.appendMaxAttempts}&amp;quot;
                                   batchSendIntervalMs=&amp;quot;${sys:logging.batchSendInterval}&amp;quot;
                                   batchMaxRecords=&amp;quot;${sys:logging.batchMaxRecords}&amp;quot;
                                   memBufferMaxSize=&amp;quot;${sys:logging.memBufferMaxSize}&amp;quot;
                                   journalMaxWriteBatchSize=&amp;quot;${sys:logging.journalMaxBatchSize}&amp;quot;
                                   journalMaxFileSize=&amp;quot;${sys:logging.journalMaxFileSize}&amp;quot;
                                   clientMaxPacketSize=&amp;quot;${sys:logging.clientMaxPacketSize}&amp;quot;
                                   clientConnectTimeoutMs=&amp;quot;${sys:logging.clientConnectTimeout}&amp;quot;
                                   clientSocketTimeoutMs=&amp;quot;${sys:logging.clientSocketTimeout}&amp;quot;
                                   serverAddressPollIntervalMs=&amp;quot;${sys:logging.serverAddressPollInterval}&amp;quot;
                                   serverHeartbeatSendIntervalMs=&amp;quot;${sys:logging.serverHeartbeatSendIntervalMs}&amp;quot;
                                   statisticsPrintIntervalMs=&amp;quot;${sys:logging.statisticsPrintIntervalMs}&amp;quot;&amp;gt;

            &amp;lt;PatternLayout pattern=&amp;quot;[%d{MM-dd HH:mm:ss}] %-5p %c{1} [%t] CUSTOM: %m%n&amp;quot;/&amp;gt;
        &amp;lt;/Log4J2CloudhubLogAppender&amp;gt;

&lt;/pre&gt; 

And add this appender along with your file appender .
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;AppenderRef ref=&amp;quot;CLOUDHUB&amp;quot;/&amp;gt;
&lt;/pre&gt;

Now you can deploy it on cloud hub and it should work fine . &lt;/br&gt;

You can also change Additional log levels and categories to include in logs in cloud hub . &lt;/br&gt;

Just click on Manage Application -&gt; Settings -&gt; Logging &lt;/br&gt;&lt;/br&gt;

There you can see logging levels , select desired logging level from drop down and write your package name , like com.mulesoft . And then click on apply changes . And those changes will be affected in your cloudhub logs 

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMvKgjgMZDf3lSrcfp0mS-yk_Dp1mqBKybmrQvSwwfIKwVrj3IxIqGo264gnQ_R-HqONDvf9Wkpv_wKMyMwPfTFFEU8Q1MdJnV5elRhb7P847d1pUWrfrEvOy6A4epP7PErD9j3vrFkyFt/s1600/loggingInCloudHub.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMvKgjgMZDf3lSrcfp0mS-yk_Dp1mqBKybmrQvSwwfIKwVrj3IxIqGo264gnQ_R-HqONDvf9Wkpv_wKMyMwPfTFFEU8Q1MdJnV5elRhb7P847d1pUWrfrEvOy6A4epP7PErD9j3vrFkyFt/s320/loggingInCloudHub.jpg" width="320" height="180" data-original-width="1600" data-original-height="900" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

Provide Comments and Suggestions !!!

&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMvKgjgMZDf3lSrcfp0mS-yk_Dp1mqBKybmrQvSwwfIKwVrj3IxIqGo264gnQ_R-HqONDvf9Wkpv_wKMyMwPfTFFEU8Q1MdJnV5elRhb7P847d1pUWrfrEvOy6A4epP7PErD9j3vrFkyFt/s72-c/loggingInCloudHub.jpg" width="72"/></item><item><title>How to make Poller Component Efficient In MULE ESB </title><link>http://www.javaroots.com/2017/06/how-to-make-poller-efficient-mule-esb.html</link><category>MULE ESB</category><category>Multithreading</category><category>POLLER</category><category>REQUEST-REPLY</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Thu, 8 Jun 2017 18:06:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-7161449650186322873</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Poller in MULE ESB is a very important component when you want to keep polling a endpoint for changes and then process it . Most of the times we do not know how big the changes will be and how much time will it take to complete . So setting polling interval becomes very crucial  , because you do not want to trigger a new process before completing the existing task , and also you do not want to lose too much time waiting for the next trigger , if you complete the process earlier .
&lt;/br&gt;&lt;/br&gt;

Following code snippet solves your problem , it achieves synchronous behavior and poller will wait if the process is taking some time , it also achieves asynchornous efficiency where if you have 10 results then 10 separate process will be executed and main poller flow will still wait for them to complete . &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

Code is self explanatory , i have used simple request reply and aggregator pattern , hope it helps .  



&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;

&amp;lt;mule xmlns:vm=&amp;quot;http://www.mulesoft.org/schema/mule/vm&amp;quot; xmlns:scripting=&amp;quot;http://www.mulesoft.org/schema/mule/scripting&amp;quot; xmlns:http=&amp;quot;http://www.mulesoft.org/schema/mule/http&amp;quot; xmlns:metadata=&amp;quot;http://www.mulesoft.org/schema/mule/metadata&amp;quot; xmlns:dw=&amp;quot;http://www.mulesoft.org/schema/mule/ee/dw&amp;quot; xmlns:db=&amp;quot;http://www.mulesoft.org/schema/mule/db&amp;quot; xmlns:batch=&amp;quot;http://www.mulesoft.org/schema/mule/batch&amp;quot; xmlns:sfdc=&amp;quot;http://www.mulesoft.org/schema/mule/sfdc&amp;quot; xmlns:tracking=&amp;quot;http://www.mulesoft.org/schema/mule/ee/tracking&amp;quot; xmlns=&amp;quot;http://www.mulesoft.org/schema/mule/core&amp;quot; xmlns:doc=&amp;quot;http://www.mulesoft.org/schema/mule/documentation&amp;quot;
 xmlns:spring=&amp;quot;http://www.springframework.org/schema/beans&amp;quot; 
 xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
 xsi:schemaLocation=&amp;quot;http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd&amp;quot;&amp;gt;
    
    
    
    &amp;lt;flow name=&amp;quot;exampleFlow&amp;quot; processingStrategy=&amp;quot;synchronous&amp;quot; &amp;gt;
     
         &amp;lt;poll doc:name=&amp;quot;Poll&amp;quot; &amp;gt;
          &amp;lt;fixed-frequency-scheduler frequency=&amp;quot;10000&amp;quot; timeUnit=&amp;quot;MILLISECONDS&amp;quot;&amp;gt;&amp;lt;/fixed-frequency-scheduler&amp;gt;
          &amp;lt;logger message=&amp;quot;Upload tour poll started&amp;quot; level=&amp;quot;DEBUG&amp;quot;&amp;gt;&amp;lt;/logger&amp;gt;
          
         &amp;lt;/poll&amp;gt;
        
        &amp;lt;expression-component&amp;gt;
         payload = new java.util.ArrayList();
         payload.add(&amp;quot;test&amp;quot;);
         payload.add(&amp;quot;test2&amp;quot;);
        &amp;lt;/expression-component&amp;gt;
        &amp;lt;choice &amp;gt;
         &amp;lt;when expression=&amp;quot;#[payload.size()  &amp;amp;gt;0]&amp;quot;&amp;gt;
          &amp;lt;request-reply doc:name=&amp;quot;Request-Reply&amp;quot; &amp;gt;
               &amp;lt;vm:outbound-endpoint exchange-pattern=&amp;quot;one-way&amp;quot; path=&amp;quot;download_tour_vm&amp;quot; doc:name=&amp;quot;VM&amp;quot;&amp;gt;
                           &amp;lt;collection-splitter /&amp;gt;
               &amp;lt;/vm:outbound-endpoint&amp;gt;
               &amp;lt;vm:inbound-endpoint exchange-pattern=&amp;quot;one-way&amp;quot; path=&amp;quot;aggregated_download_tour_vm&amp;quot; doc:name=&amp;quot;VM&amp;quot;&amp;gt;
                           &amp;lt;collection-aggregator /&amp;gt;
               &amp;lt;/vm:inbound-endpoint&amp;gt;
    &amp;lt;/request-reply&amp;gt;
           &amp;lt;logger message=&amp;quot;COMPLETED EXAMPLE&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt; 
         &amp;lt;/when&amp;gt;
         &amp;lt;otherwise&amp;gt;
          &amp;lt;logger message=&amp;quot;No Record To Process&amp;quot; level=&amp;quot;INFO&amp;quot;/&amp;gt;
         &amp;lt;/otherwise&amp;gt;
        
        &amp;lt;/choice&amp;gt;   
        
    &amp;lt;/flow&amp;gt;
    
    
    
    
    
    
    &amp;lt;flow name=&amp;quot;downloadTour&amp;quot;&amp;gt;
       &amp;lt;vm:inbound-endpoint  path=&amp;quot;download_tour_vm&amp;quot; doc:name=&amp;quot;VM&amp;quot;/&amp;gt;
       
       &amp;lt;scripting:component doc:name=&amp;quot;Groovy&amp;quot;&amp;gt;
            &amp;lt;scripting:script engine=&amp;quot;Groovy&amp;quot;&amp;gt;&amp;lt;![CDATA[sleep(20000);
return message.payload;]]&amp;gt;&amp;lt;/scripting:script&amp;gt;
        &amp;lt;/scripting:component&amp;gt;
    &amp;lt;/flow&amp;gt;

    
&amp;lt;/mule&amp;gt;

&lt;/pre&gt;
Post comments and suggestions .!!

&lt;br /&gt;&lt;/div&gt;
</description></item><item><title>How to create AWS - s3 bucket using terraform </title><link>http://www.javaroots.com/2017/02/how-to-create-aws-s3-bucket-using.html</link><author>noreply@blogger.com (Santosh Mohanty)</author><pubDate>Fri, 17 Feb 2017 04:56:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-6277522104143188653</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="container-fluid"&gt;
&lt;div class="row"&gt;
&lt;div class="col-md-12"&gt;
&lt;blockquote&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
       
       &lt;b&gt;Digitized and Automated Infrastructure is all we need !!!&lt;/b&gt;
      &lt;/blockquote&gt;
&amp;nbsp;Before we begin learning and coding our infrastructure,&amp;nbsp;let us know why we need it.
     
      
      
      
      
      &lt;br /&gt;
&lt;br /&gt;
Think you have an infrastructure&amp;nbsp;in AWS where you have multiple s3 buckets/instances/ELB/ALB/SG/ VPC/Gateways/NAT attached to these resources and most importantly everything is bought up manually.
     
      
      
      
      
      &lt;br /&gt;
&lt;br /&gt;
?? What happens when some resource goes down (&#128552; &#128552;) and most of them are dependent, you break your head in this mundane job searching and fixing your resources one at a time and testing everything.
     
      
      
      
      
      &lt;br /&gt;
&lt;br /&gt;
?? What if we come up with an idea to write the infrastructure and enable debugging with fixing at a place where every resource will be up and running. And it is all about spinning and getting out of your infrastructure in less or no time. Here is what      
     
      
      
      
      
      &lt;a href="https://www.terraform.io/" target="_blank"&gt;Terraform &lt;/a&gt;&amp;nbsp;provides you .     
     
      
      
      
      
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
       &lt;i&gt;Terraform enables you to safely and predictably create, change, and improve infrastructure. 
       
        
        
        
        
        &lt;br /&gt;It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.&amp;nbsp;
      
       
       
       
       
       &lt;/i&gt;
      &lt;/b&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;div class="row"&gt;
&lt;div class="col-md-12"&gt;
&lt;div class="_e725ae-textarea_btn _e725ae-not_focused"&gt;
&lt;div class="_e725ae-transform_wrap"&gt;
&lt;div class="_e725ae-status"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;a href="https://www.terraform.io/intro/index.html"&gt;Terraform Features&lt;/a&gt;:
       
        
        
        
        
        &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
          &lt;span style="background-color: white; box-sizing: border-box; color: #242424; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 18px;"&gt;Infrastructure as Code&lt;/span&gt;
         &lt;/li&gt;
&lt;li&gt;
          &lt;span style="background-color: white; box-sizing: border-box; color: #242424; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 18px;"&gt;Execution Plans&lt;/span&gt;
         &lt;/li&gt;
&lt;li&gt;
          &lt;span style="background-color: white; box-sizing: border-box; color: #242424; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 18px;"&gt;Resource Graph&lt;/span&gt;
         &lt;/li&gt;
&lt;li&gt;
          &lt;span style="background-color: white; box-sizing: border-box; color: #242424; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 18px;"&gt;Change Automation&lt;/span&gt;
         &lt;/li&gt;
&lt;/ul&gt;
&lt;div class="_e725ae-textarea_btn _e725ae-not_focused"&gt;
&lt;div class="_e725ae-transform_wrap"&gt;
&lt;div class="_e725ae-status"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
Running a marathon using terraform ....&lt;/h2&gt;
&lt;br /&gt;
Let's not waste our time and start creating an s3 bucket in AWS &amp;nbsp;using terraform.
       
        
        
        
        
        &lt;br /&gt;
&lt;br /&gt;
Terraform supports almost all of the providers, I choose AWS to create my infra in this blog, You can use yours.
       
        
        
        
        
        &lt;br /&gt;
&lt;br /&gt;
Before proceeding make sure you have an AWS account to create your infrastructure.
Follow the steps to create a s3 infra :(Install terraform from 
        
        
        &lt;a href="https://www.terraform.io/intro/getting-started/install.html" target="_blank"&gt; Terraform Installation Guide &lt;/a&gt;)
     
        
        
        &lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;mkdir ~/terraform_infra
cd ~/terraform_infra
touch s3.tf
&lt;/pre&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
Lets go through the Code Step wise :
        
        &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="_e725ae-textarea_btn _e725ae-not_focused"&gt;
&lt;div class="_e725ae-transform_wrap"&gt;
&lt;div class="_e725ae-status"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="col-md-4"&gt;
&lt;div class="thumbnail"&gt;
&lt;img border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBCJHYnlaKCMclzYvh_MQu_DlHvSW_J5vb7g_tPZi2JIr8XZ0SkOFaZIY2I2GCqOmRX7Z8A75b5mHvVA3sRRLOsYLErgsXfr8sUjRiQaQTd9UsIO3uW1aA3299bsqkxPYdVsGn8ENnFTQ/s400/Screen+Shot+2017-02-17+at+17.32.17.png" width="400" /&gt;
         &lt;br /&gt;
&lt;div class="caption"&gt;
&lt;h3&gt;
        Provider.tf&lt;/h3&gt;
The provider block here says we are using aws as our provider where :
          
          &lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;region : Region where our resource will be created&lt;/li&gt;
&lt;li&gt;Key/Secret : Provided by AWS&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="col-md-4"&gt;
&lt;div class="thumbnail"&gt;
&lt;img border="0" height="153" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHknY_m5NIZPVKQ5lq4J32elNRyli27i9Zw3H0j1kqRaslKV52_URJONB_EMXFyY5K4N7OFhjYHvR14ZoXukjUW6Cz2zt4wnUC3fYnMXPQ_RD3RyUqW39r4VcVkvnGl3e-IpJLfB4SgNk/s400/Screen+Shot+2017-02-17+at+17.31.22.png" width="400" /&gt;
         &lt;br /&gt;
&lt;div class="caption"&gt;
&lt;h3&gt;
        resource.tf&lt;/h3&gt;
The resource block says what resource we are creating in infra.
          
          &lt;br /&gt;
Here aws_s3_bucket is resource which terraform understands to create bucket
          
          &lt;br /&gt;
echo_stage_bucket is our reference to s3 bucket
          
          &lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;bucket: bucket name that will be created in aws&lt;/li&gt;
&lt;li&gt;acl: bucket type (public/private)&lt;/li&gt;
&lt;li&gt;tags: tags your environment&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="col-md-4"&gt;
&lt;div class="thumbnail"&gt;
&lt;img alt="Bootstrap Thumbnail Third" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSl5mHire4OCcPGh454zSdPMnDdFEUXEapuuOiv19pffhnNxSCQQv2PDAf2H5tjRbRu9FUrFKblnNUXL1IdNCLNmUV0l3TT77YLphUdSCVbU_wcFvrqpqMi0CvzqR6-7d6rP1LCvdIHqE/s400/Screen+Shot+2017-02-17+at+17.31.13.png" width="400" /&gt;
         &lt;br /&gt;
&lt;div class="caption"&gt;
&lt;h3&gt;
        storage.tf&lt;/h3&gt;
data block (terraform_remote_stage) is used to say terraform that where we want to store our terraform state file
          
          &lt;br /&gt;
&lt;br /&gt;
This is needed because once we create the infrastructure we need to version and maintain state if we loose it , we lost our infrastruture state , Here I am using s3 to store my tf state
          
          &lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;backend: where to store the state file&lt;/li&gt;
&lt;li&gt;bucket: bucket name we are referencing the bucket that we have created&lt;/li&gt;
&lt;li&gt;key : filename that will be saved&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Final Script s3.tf :
           &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBnZu-rAYaMOgsclivDs2mp2NlBiqegk1X-l3lXhvXUBzcXqiI0dKUmKWu1iGECKCHKmnbRjRjet5dtInHYvbp4Vv4zzb1hLEwqh_CprzQZTmXTLPnnEno6TwfY_KOuMm9S0BVKVcqbVQ/s1600/Screen+Shot+2017-02-17+at+18.20.01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;
             &lt;img border="0" height="433" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBnZu-rAYaMOgsclivDs2mp2NlBiqegk1X-l3lXhvXUBzcXqiI0dKUmKWu1iGECKCHKmnbRjRjet5dtInHYvbp4Vv4zzb1hLEwqh_CprzQZTmXTLPnnEno6TwfY_KOuMm9S0BVKVcqbVQ/s640/Screen+Shot+2017-02-17+at+18.20.01.png" width="640" /&gt;
            &lt;/a&gt;
           &lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre class="prettyprint lang-java"&gt; ➜ terraform plan

+ aws_s3_bucket.echo_stage_bucket
    acceleration_status: "&lt;computed&gt;"
    acl:                 "private"
    arn:                 "&lt;computed&gt;"
    bucket:              "echo_stage_test_bucket"
    bucket_domain_name:  "&lt;computed&gt;"
    force_destroy:       "false"
    hosted_zone_id:      "&lt;computed&gt;"
    region:              "&lt;computed&gt;"
    request_payer:       "&lt;computed&gt;"
    tags.%:              "2"
    tags.Environment:    "Dev"
    tags.Name:           "EchoStage Bucket"
    versioning.#:        "&lt;computed&gt;"
    website_domain:      "&lt;computed&gt;"
    website_endpoint:    "&lt;computed&gt;"

&lt;= data.terraform_remote_state.store_tf_state
    backend:        "s3"
    config.%:       "4"
    config.bucket:  "echo_stage_test_bucket"
    config.key:     "state_file/terraform.tfstate"
    config.profile: "default"
    config.region:  "us-east-1"


Plan: 1 to add, 0 to change, 0 to destroy.


Lets Create the infra : 


➜ terraform apply
aws_s3_bucket.echo_stage_bucket: Creating...
  acceleration_status: "" =&gt; "&lt;computed&gt;"
  acl:                 "" =&gt; "private"
  arn:                 "" =&gt; "&lt;computed&gt;"
  bucket:              "" =&gt; "echo_stage_test_bucket"
  bucket_domain_name:  "" =&gt; "&lt;computed&gt;"
  force_destroy:       "" =&gt; "false"
  hosted_zone_id:      "" =&gt; "&lt;computed&gt;"
  region:              "" =&gt; "&lt;computed&gt;"
  request_payer:       "" =&gt; "&lt;computed&gt;"
  tags.%:              "" =&gt; "2"
  tags.Environment:    "" =&gt; "Dev"
  tags.Name:           "" =&gt; "EchoStage Bucket"
  versioning.#:        "" =&gt; "&lt;computed&gt;"
  website_domain:      "" =&gt; "&lt;computed&gt;"
  website_endpoint:    "" =&gt; "&lt;computed&gt;"
aws_s3_bucket.echo_stage_bucket: Still creating... (10s elapsed)
aws_s3_bucket.echo_stage_bucket: Creation complete
data.terraform_remote_state.store_tf_state: Refreshing state...

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.

State path: terraform.tfstate

 &lt;/pre&gt;
You would have got the terraform.tfstate state file in your local , Lets push this to created s3 bucket:&lt;br /&gt;
&lt;br /&gt;
Exceute:

           &lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;➜  terraform-infra terraform remote  config -backend=s3  -backend-config="bucket=echo_stage_test_bucket" -backend-config="key=state_file/terraform.tfstate" -backend-config="region=us-east-1"

Remote state management enabled

Remote state configured and pulled.

&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
For any Queries 
           &lt;a href="mailto:someone@example.com?Subject=Hello%20again" target="_top"&gt;Send Mail&lt;/a&gt;
          &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBCJHYnlaKCMclzYvh_MQu_DlHvSW_J5vb7g_tPZi2JIr8XZ0SkOFaZIY2I2GCqOmRX7Z8A75b5mHvVA3sRRLOsYLErgsXfr8sUjRiQaQTd9UsIO3uW1aA3299bsqkxPYdVsGn8ENnFTQ/s72-c/Screen+Shot+2017-02-17+at+17.32.17.png" width="72"/></item><item><title>How to use Apache HttpClient 4.5 for Https Connections</title><link>http://www.javaroots.com/2017/02/how-to-use-apache-httpclient-45-https.html</link><category>CORE JAVA</category><category>HttpClient</category><category>HTTPS</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Mon, 13 Feb 2017 03:51:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-1195890986600771652</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

This is a simple example on how to use Apache HttpClient 4.5 with connection pool manager to request https urls . &lt;/br&gt;
&lt;pre class="prettyprint lang-java"&gt;
package com.javaroots;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

import javax.net.ssl.*;

import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.ssl.SSLContexts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.javaroots.DummyTrustManager;

public class HttpClientFactory {

    private static CloseableHttpClient client;

    private static PoolingHttpClientConnectionManager connPool = null;

    private static final Logger LOGGER = LoggerFactory.getLogger(HttpClientFactory.class);

    static{
        try
        {
            SSLContext sslcontext = SSLContexts.custom().loadTrustMaterial(new TrustSelfSignedStrategy()).build();
            sslcontext.init(new KeyManager[0], new TrustManager[] { new DummyTrustManager() }, new SecureRandom());
            sslcontext.init(null, new X509TrustManager[]{new HttpsTrustManager()}, new SecureRandom());
            SSLConnectionSocketFactory factory = new SSLConnectionSocketFactory(sslcontext,
                    new HostnameVerifier() {
                        @Override
                        public boolean verify(final String s, final SSLSession sslSession) {

                            return true;
                        }
                    });

            Registry&lt;ConnectionSocketFactory&gt; r = RegistryBuilder.&lt;ConnectionSocketFactory&gt; create()
                    .register("https", factory).build();

            connPool = new PoolingHttpClientConnectionManager(r);
            // Increase max total connection to 200
            connPool.setMaxTotal(200);
            
            connPool.setDefaultMaxPerRoute(20);


            client = HttpClients.custom().
                    setConnectionManagerShared(true).
                    setConnectionManager(connPool).
                    setSSLSocketFactory(factory).build();
        }
        catch(Exception e){
            LOGGER.error("Error initiliazing HttpClientFactory :: ",e);
        }
    }

    public static CloseableHttpClient getHttpsClient() throws KeyManagementException, NoSuchAlgorithmException  {

        if (client != null) {
            return client;
        }
        throw new RuntimeException("Client is not initiliazed properly");

    }
    public static void releaseInstance() {
        client = null;
    }
}

&lt;/pre&gt;
In above code if you do not use &lt;b&gt;setConnectionManagerShared(true)&lt;/b&gt; , you might get following error .
&lt;pre class="prettyprint lang-java"&gt;
java.lang.IllegalStateException: Connection pool shut down
&lt;/pre&gt;
Now if you want to use HttpClient to call Https Urls and with help of connection pools , you have to add a registry in your connection pool , otherwise it will ignore your SSLContext configurations , and give following error .

&lt;pre class="prettyprint lang-java"&gt;
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
 at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
 at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
 at sun.security.validator.Validator.validate(Validator.java:260)
 at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
 at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
 at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
 at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
 ... 80 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
 at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
 at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
 at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
 at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
 ... 86 more
&lt;/pre&gt;
&lt;pre class="prettyprint lang-java"&gt;
package com.javaroots;

import java.io.IOException;
import java.net.URI;

import javax.ws.rs.core.MediaType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;



public class ApacheClient {

    private static final Logger LOGGER = LoggerFactory.getLogger(ApacheClient.class);


 public static void main(String[] args) throws Exception{
  CloseableHttpClient apacheClient = HttpClientFactory.getHttpsClient();


  CloseableHttpResponse response2 = null;
  HttpGet httpPost = new HttpGet("https://mms.nw.ru/");
  RequestConfig defaultRequestConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000)
    .build();
  HttpEntity entity2 = null;
  try {
   httpPost.setConfig(defaultRequestConfig);
   response2 = apacheClient.execute(httpPost);

   System.out.println(response2.getStatusLine());

  } catch (Exception e) {
   LOGGER.error("Error while getting response: ", e);
   throw new HttpClientException(e);
  } finally {
   try {
    response2.close();
    apacheClient.close();
   } catch (Exception e) {

   }

  }
 }



}
&lt;/pre&gt;

&lt;br /&gt;&lt;/div&gt;</description></item><item><title>Dockerizing an existing Rails application</title><link>http://www.javaroots.com/2017/02/dockerizing-existing-rails-application.html</link><category>Container</category><category>Docker</category><category>RAILS</category><category>RUBY</category><author>noreply@blogger.com (Santosh Mohanty)</author><pubDate>Mon, 6 Feb 2017 02:25:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5861140167507744229</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&amp;nbsp; Docker is a relatively new and rapidly growing project that allows creating very light “virtual machines”.&lt;br /&gt;
&lt;h3 id="prerequisites"&gt;
Prerequisites&lt;/h3&gt;
There are no specific skills needed for this tutorial beyond a basic comfort with the command line and using a text editor. The following services are needed:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/"&gt;Docker Hub&lt;/a&gt;&amp;nbsp;(Login - Signup if you haven't )&lt;/li&gt;
&lt;li&gt;A Rails application&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="setting-up-your-computer"&gt;
Setting up your computer&lt;/h3&gt;
Getting all the tooling setup on your computer can be a daunting task, but thankfully as Docker has become stable, getting Docker up and running on your favorite OS has become very easy. First, we'll install Docker.&lt;br /&gt;

Until a few releases ago, running Docker on OSX and Windows was quite a hassle. Lately, however, Docker has invested significantly into improving the onboarding experience for its users on these OSes, thus running Docker now is a cakewalk. The &lt;em&gt;getting started&lt;/em&gt; guide on Docker has detailed instructions for setting up Docker on &lt;a href="https://www.docker.com/products/docker#/mac"&gt;Mac&lt;/a&gt;, &lt;a href="https://www.docker.com/products/docker#/linux"&gt;Linux&lt;/a&gt;, and &lt;a href="https://www.docker.com/products/docker#/windows"&gt;Windows&lt;/a&gt;.&lt;br /&gt;
Once you are done installing Docker, test your Docker installation by running the following:&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;$ docker run hello-world

Hello from Docker.

This message shows that your installation appears to be working correctly.
...
&lt;/pre&gt;

&lt;strong&gt;Starting with a Rails Application:
&lt;/strong&gt; 
&lt;strong&gt;
I will not be going through docker commands as that would be found on dockers website and many blog sites.
&lt;/strong&gt; 
There are different ways you can deploy your Ruby applications in a Docker container.
 You can either choose one of the many existing Ruby images on the &lt;a href="https://registry.hub.docker.com/search?q=ruby&amp;amp;searchfield="&gt;public docker registry &lt;/a&gt;
&lt;h2 id="building-the-base-image"&gt;
Building the base image&lt;/h2&gt;
This image will set a base for the rest of the post as we will use the resulting image to create our set of Rails images.&lt;br /&gt;
The image will contain all the things Rails expects to compile and run properly on a Debian based OS. I am not going to talk about the required packages, instead, I am going to focus on the separation of concerns and configuration of the set of images.&lt;br /&gt;
One thing to keep in mind is that the image we’ll build is only for RubyOnRails and will not contain any database related packages. If there’s a need to install a gem with native extensions requiring “extra” packages those should go into that specific image unless all of your apps require it.&lt;br /&gt;
&lt;strong&gt;What should you expect from this image?&lt;/strong&gt;&lt;br /&gt;
This image will not complain about any TTY warnings during installation because of the flag(&lt;span style="background-color: #f5f6f5; font-family: monospace , serif;"&gt;noninteractive&lt;/span&gt;) we are using, all your applications will use as&amp;nbsp;encoding(&lt;span style="background-color: #f5f6f5; font-family: monospace , serif;"&gt;en_US.UTF-8&lt;/span&gt;) .thencoding.&lt;br /&gt;
Find the below Image and explanation as followed.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;I am using ruby 1.9.3 for my Project.&lt;/li&gt;
&lt;li&gt;Gemfile is already built with rails 3.2.3, You can use your own Gemfile.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;#Dockerfile&lt;/strong&gt;&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;FROM ubuntu:trusty  # Using Ubuntu OS
MAINTAINER "Santosh Mohanty &amp;lt;santa.jyp@gmail.com&amp;gt;" # Maintainer Name
RUN apt-get update # Updating OS

ENV PATH /usr/local/rvm/bin:$PATH  # Set ENV Path

RUN apt-get update &amp;amp;&amp;amp; apt-get -y upgrade &amp;amp;&amp;amp; apt-get -y install ruby 1.9.3 # Installation of Ruby
RUN ln -sf /usr/bin/ruby1.9.3 /etc/alternatives/ruby

# basics
RUN apt-get install -y build-essential
RUN apt-get install -y mysql-client libmysqlclient-dev openssl libreadline6 
                       libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev
                       libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev
                       ncurses-dev automake libtool bison subversion pkg-  config gawk 
                       libgdbm-dev libffi-dev npm

RUN gem install bundler
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
WORKDIR /app
RUN bundle install
ADD . /app      # Adds your Project Structure to docker
ENV ENVIRONMENT development
CMD ["rails","s"]

EXPOSE 3000 # Exposing PORT 3000 for Development
&lt;/pre&gt;
&lt;h4&gt;
Executing the Image:&lt;/h4&gt;
Follow the Below steps to Build your Docker Image from Dockerfile:&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;docker build -t rails_image ~/workspace/PATH_TO_DOCKERFILE
docker run -p 3000:3000&amp;nbsp;rails_image # Mapping container port 3000 to local port 3000
&lt;/pre&gt;
This would run your rails application inside docker container&lt;br /&gt;
Few Imp commands:&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;docker run -it rails_image&amp;nbsp;/bin/bash # this would bring up the bash prompt of docker
docker images # List Images
docker rmi&amp;nbsp;IMAGE_ID -f &amp;nbsp;# remove Image
docker ps &amp;nbsp;# for listing running containers.
&lt;/pre&gt;

&lt;blockquote&gt;You may find difficulties in connecting to DB from Container,
This can be solved running a DB Image or pointing to Specific IP of DB instead of local IP.
&lt;p&gt;
I will be writing a blog on how to connect MySQL DB Image to Rails Image using docker compose. &lt;/p&gt;&lt;/blockquote&gt;
&lt;/div&gt;
</description></item><item><title>GC overhead limit exceeded Out Of Memory Error In JDBC</title><link>http://www.javaroots.com/2017/01/gc-overhead-limit-oom-error-jdbc.html</link><category>CORE JAVA</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 4 Jan 2017 02:39:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5736297225871070375</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have encountered this error when i was trying to insert a big list of object in to database , using jdbc . The list size was approximately 100k . One way to resolve this error to increase your memory size . I double checked my code and found that i have not closed the PreparedStatement Object in my DAO class . &lt;/br&gt;&lt;/br&gt;
&lt;pre class="prettyprint lang-java"&gt;
java.lang.OutOfMemoryError: GC overhead limit exceeded
 at java.util.Calendar$Builder.build(Calendar.java:1482)
 at sun.util.locale.provider.CalendarProviderImpl.getInstance(CalendarProviderImpl.java:88)
 at java.util.Calendar.createCalendar(Calendar.java:1666)
 at java.util.Calendar.getInstance(Calendar.java:1655)
 at java.text.SimpleDateFormat.initializeCalendar(SimpleDateFormat.java:657)
 at java.text.SimpleDateFormat.&lt;init&gt;(SimpleDateFormat.java:601)
 at com.mysql.jdbc.PreparedStatement.setTimestampInternal(PreparedStatement.java:4321)
 at com.mysql.jdbc.PreparedStatement.setTimestamp(PreparedStatement.java:4274)
 at org.apache.commons.dbcp.DelegatingPreparedStatement.setTimestamp(DelegatingPreparedStatement.java:147)
 at org.apache.commons.dbcp.DelegatingPreparedStatement.setTimestamp(DelegatingPreparedStatement.java:147)
 at ch.koala.dao.ProductDAO.insert(ProductDAO.java:42)
 at ch.koala.services.ProductSyncJob.execute(ProductSyncJob.java:64)
 at ch.koala.services.RestServices.productSyncJobExecute(RestServices.java:4020)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:187)
 at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:71)
 at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:280)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1341)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1273)
 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223)
 at org.mule.module.jersey.JerseyResourcesComponent.doInvoke(JerseyResourcesComponent.java:159)
 at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:122)
 at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:57)
 at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:238)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)

&lt;/pre&gt;
So to solve this issue , if you encounter while using JDBC , just call close method on your PreparedStatement object , after you finished your work on that , and you might get rid of this error . &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

Please Post Comments and Suggestions !!!

&lt;br /&gt;&lt;/div&gt;</description></item><item><title>Malformed Expression Error Mule ESB </title><link>http://www.javaroots.com/2016/12/malformed-expression-error-mule-esb.html</link><category>CORE JAVA</category><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Fri, 30 Dec 2016 02:13:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-1567762658506496434</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have got the following error when i tried to write java 8 stream in my expression component .

&lt;pre class="prettyprint lang-java"&gt;
Message               : [Error: Malformed expression]
[Near : {... t.stream().map(a-&gt;a+"dd").collect(java.util.stream ....}]
                                   ^
[Line: 5, Column: 46] (org.mule.api.expression.InvalidExpressionException). Message payload is of type: NullPayload
Type                  : org.mule.api.MessagingException
Code                  : MULE_ERROR-29999
JavaDoc               : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
Payload               : {NullPayload}
********************************************************************************
Exception stack is:
1. [Error: Malformed expression]
[Near : {... t.stream().map(a-&gt;a+"dd").collect(java.util.stream ....}]
                                   ^
[Line: 5, Column: 46] (org.mule.api.expression.InvalidExpressionException)
  org.mule.el.mvel.MVELExpressionLanguage:238 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/InvalidExpressionException.html)
2. [Error: Malformed expression]
[Near : {... t.stream().map(a-&gt;a+"dd").collect(java.util.stream ....}]
                                   ^
[Line: 5, Column: 46] (org.mule.api.expression.InvalidExpressionException). Message payload is of type: NullPayload (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************
Root Exception stack trace:
org.mule.api.expression.InvalidExpressionException: [Error: Malformed expression]
[Near : {... t.stream().map(a-&gt;a+"dd").collect(java.util.stream ....}]
                                   ^
[Line: 5, Column: 46]
 at org.mule.el.mvel.MVELExpressionLanguage.validate(MVELExpressionLanguage.java:238)
 at org.mule.el.mvel.MVELExpressionLanguage.evaluateInternal(MVELExpressionLanguage.java:189)
 at org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:154)
 at org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:133)
 at org.mule.el.ExpressionLanguageComponent.process(ExpressionLanguageComponent.java:51)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:54)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:40)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.construct.AbstractPipeline$1.process(AbstractPipeline.java:109)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.construct.AbstractPipeline$3.process(AbstractPipeline.java:207)
 at org.mule.module.http.internal.listener.HttpMessageProcessorTemplate.routeEvent(HttpMessageProcessorTemplate.java:72)
 at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:52)
 at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:47)
 at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
 at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
 at org.mule.execution.HandleExceptionIntercepto...
********************************************************************************
&lt;/pre&gt;
And here is my mule flow :

&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;http:listener path=&amp;quot;/foreach/test&amp;quot; config-ref=&amp;quot;myRequestConfig&amp;quot;
   allowedMethods=&amp;quot;GET&amp;quot; doc:name=&amp;quot;HTTP&amp;quot;/&amp;gt;
      &amp;lt;expression-component&amp;gt;
            java.util.ArrayList list = new java.util.ArrayList();
            list.add(&amp;quot;abc&amp;quot;);
            payload = list;
            payload = list.stream().map(a-&amp;gt;a+&amp;quot;dd&amp;quot;).collect(java.util.stream.Collectors.Collectors.toList());
         &amp;lt;/expression-component&amp;gt;
        
        &amp;lt;logger message=&amp;quot;paload : #[payload]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;

&lt;/pre&gt;
If anybody knows the answer please comment below . 
&lt;br /&gt;&lt;/div&gt;</description></item><item><title>Mule Session And Flow Var Example</title><link>http://www.javaroots.com/2016/12/mule-session-and-flow-var-example.html</link><author>noreply@blogger.com (Abhishek)</author><pubDate>Thu, 15 Dec 2016 22:34:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5606950068486988082</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is simple example in mule demonstrating use of SessionVar , FlowVar , SubFlow , Vm , ForEach ,Groovy and Expression Component .

&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;http:listener-config port=&amp;quot;8081&amp;quot; host=&amp;quot;0.0.0.0&amp;quot;
  name=&amp;quot;myRequestConfig&amp;quot; doc:name=&amp;quot;HTTP Listener Configuration&amp;quot;&amp;gt;
  &amp;lt;http:worker-threading-profile
   maxThreadsActive=&amp;quot;15&amp;quot; /&amp;gt;
 &amp;lt;/http:listener-config&amp;gt;

&amp;lt;flow name=&amp;quot;foreachexample&amp;quot;&amp;gt;
&amp;lt;http:listener path=&amp;quot;/foreach/test&amp;quot; config-ref=&amp;quot;myRequestConfig&amp;quot;
   allowedMethods=&amp;quot;GET&amp;quot; doc:name=&amp;quot;HTTP&amp;quot;/&amp;gt;
     &amp;lt;logger message=&amp;quot;RUNNNING poller ra &amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
      &amp;lt;expression-component&amp;gt;
            java.util.ArrayList list = new java.util.ArrayList();
            list.add(&amp;quot;abc&amp;quot;);
            payload = list;
         &amp;lt;/expression-component&amp;gt;
        &amp;lt;set-session-variable value=&amp;quot;true&amp;quot; variableName=&amp;quot;changeMe&amp;quot; doc:name=&amp;quot;Session Variable&amp;quot; /&amp;gt;
        &amp;lt;set-variable value=&amp;quot;true&amp;quot; variableName=&amp;quot;myFlowVar&amp;quot; doc:name=&amp;quot;Flow Variable&amp;quot; /&amp;gt;
        &amp;lt;foreach &amp;gt;
         &amp;lt;logger message=&amp;quot;fdsf&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
         &amp;lt;flow-ref name=&amp;quot;subFlowTest&amp;quot; /&amp;gt;
         &amp;lt;flow-ref name=&amp;quot;flow2&amp;quot; /&amp;gt;
         &amp;lt;vm:outbound-endpoint path=&amp;quot;/opt&amp;quot;/&amp;gt;
        &amp;lt;/foreach&amp;gt;
        &amp;lt;vm:outbound-endpoint path=&amp;quot;/opt&amp;quot;/&amp;gt;
        &amp;lt;logger message=&amp;quot;changeme : #[sessionVars.changeMe]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
    &amp;lt;/flow&amp;gt;
    
 &amp;lt;sub-flow name=&amp;quot;subFlowTest&amp;quot;&amp;gt;
  &amp;lt;logger message=&amp;quot;changeme flow var in sub flow : #[flowVars.myFlowVar]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
  &amp;lt;logger message=&amp;quot;changeme session var in sub flow: #[sessionVars.changeMe]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
  &amp;lt;scripting:component doc:name=&amp;quot;sleep&amp;quot;&amp;gt;
   &amp;lt;scripting:script engine=&amp;quot;groovy&amp;quot;&amp;gt;
                &amp;lt;scripting:text&amp;gt;&amp;lt;![CDATA[
            java.lang.Thread.sleep(5000);]]&amp;gt;&amp;lt;/scripting:text&amp;gt;
   &amp;lt;/scripting:script&amp;gt;

  &amp;lt;/scripting:component&amp;gt;
 &amp;lt;/sub-flow&amp;gt;
 &amp;lt;flow name=&amp;quot;flow2&amp;quot;&amp;gt;
  &amp;lt;vm:inbound-endpoint path=&amp;quot;/opt&amp;quot;&amp;gt;&amp;lt;/vm:inbound-endpoint&amp;gt;
  &amp;lt;logger message=&amp;quot;changeme session var in flow 2: #[sessionVars.changeMe]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
  &amp;lt;logger message=&amp;quot;changeme flow var in flow 2: #[flowVars.myFlowVar]&amp;quot; level=&amp;quot;ERROR&amp;quot;/&amp;gt;
 &amp;lt;/flow&amp;gt;

&lt;/pre&gt;

FlowVars do not get lost when you call another flow by using flow-ref , but if you call another flow by vm or any other transport , then the flow variable will be lost and you will not be able to find it in the other flow . &lt;/br&gt;&lt;/br&gt;
SessionVars will be present in each and every flow till the execution of the call . &lt;/br&gt;
This example also demonstrates how can we write java code in our mule file using groovy component and expression component . Make sure to import the packages of the class which you intend to use , otherwise use fully qualified class name in your code . &lt;/br&gt;&lt;/br&gt;


&lt;br /&gt;&lt;/div&gt;</description></item><item><title>Multipart Jersey Request Does not work with mule 3.5.0</title><link>http://www.javaroots.com/2016/12/multipart-jersey-request-does-not-work.html</link><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Fri, 2 Dec 2016 02:30:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-7379139147393469397</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

We can create file upload functionality in mule which is described in this &lt;a href="http://www.javaroots.com/2013/05/createfileuploadmulejerseyrest.html" target="_blank"&gt;blog post&lt;/a&gt;. But this solution does not work with mule version 3.5.0 and throws errors like this.

&lt;pre class="prettyprint lang-java"&gt;
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 at java.lang.String.substring(String.java:1915)
 at org.mule.transport.http.multipart.MultiPartInputStream.parse(MultiPartInputStream.java:349)
 at org.mule.transport.http.multipart.MultiPartInputStream.getParts(MultiPartInputStream.java:304)
 at org.mule.transport.http.HttpMultipartMuleMessageFactory.extractPayloadFromHttpRequest(HttpMultipartMuleMessageFactory.java:35)
 at org.mule.transport.http.HttpMuleMessageFactory.extractPayload(HttpMuleMessageFactory.java:75)
 at org.mule.transport.AbstractMuleMessageFactory.doCreate(AbstractMuleMessageFactory.java:79)
 at org.mule.transport.AbstractMuleMessageFactory.create(AbstractMuleMessageFactory.java:63)
 at org.mule.transport.AbstractTransportMessageHandler.createMuleMessage(AbstractTransportMessageHandler.java:458)
 at org.mule.transport.AbstractTransportMessageProcessTemplate.createMessageFromSource(AbstractTransportMessageProcessTemplate.java:147)
 at org.mule.transport.http.HttpMessageProcessTemplate.createMessageFromSource(HttpMessageProcessTemplate.java:286)
 at org.mule.transport.AbstractTransportMessageProcessTemplate.getMuleEvent(AbstractTransportMessageProcessTemplate.java:48)
 at org.mule.execution.FlowProcessingPhase$1$1.process(FlowProcessingPhase.java:74)
 at org.mule.execution.FlowProcessingPhase$1$1.process(FlowProcessingPhase.java:63)
 at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
 at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
 at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
 at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
 at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
 at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
 at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
 at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
 at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
 at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
 at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
 at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)
 at org.mule.execution.FlowProcessingPhase$1.run(FlowProcessingPhase.java:62)
 at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
 at org.mule.work.WorkerContext.run(WorkerContext.java:286)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)


&lt;/pre&gt; 
This is a known &lt;a href="https://www.mulesoft.org/jira/browse/MULE-7828" target="_blank"&gt;issue&lt;/a&gt; in mule and it is rectified in further version of mule , but not in 3.5.0 . &lt;/br&gt;

Now to resolve this , you need to remove mule-transport-http-3.5.0.jar file from mule_home/lib/mule folder and add mule-transport-http-3.3.1.jar and restart mule . It should work fine after that . 



&lt;br /&gt;&lt;/div&gt;</description></item><item><title>Access Denied Error When Sending Mail From Java</title><link>http://www.javaroots.com/2016/11/access-denied-error-when-sending-mail.html</link><category>CORE JAVA</category><category>SMTP</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 30 Nov 2016 22:46:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5842378581443416661</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

Sending Email from Java Class is very simple.Here is a simple java program to send emails .
&lt;pre class="prettyprint lang-java"&gt;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Properties;

/**
 * Created by abhishek.somani on 30/11/16.
 */
public class MailSender {

    public static void main(String[] args) throws MessagingException {
        new MailSender().sendMail();
    }

    public void sendMail() throws MessagingException {
        System.setProperty("mail.smtp.localhost","localhost");
        Properties props = new Properties();
        props.put("mail.smtp.localhost","javaroots.com");
        props.put("mail.smtp.host","javaroots.host");
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.port", 587);
        
        Session session = Session.getInstance(props,
                new javax.mail.Authenticator() {
                    protected PasswordAuthentication getPasswordAuthentication() {
                        return new PasswordAuthentication("test@test", "abcd");
                    }
                });
        session.setDebug(true);

        InternetAddress[] toAddress = new InternetAddress[1];
        toAddress = InternetAddress.parse("gmail@rajnikant.com",false);

        Transport t = session.getTransport("smtp");
        t.connect("host",
                587,"abcd","abcd");
        MimeMessage message = new MimeMessage(session);

        message.setFrom(new InternetAddress("gmail@amitabh.com"));
        message.setRecipients(Message.RecipientType.TO,
                toAddress);
        message.setSubject("Testing Subject");

        String body = "DSADSADAASDD";
        message.setText(body,"utf-8");
        t.send(message,message.getAllRecipients());
    }

}


&lt;/pre&gt;
Now this program gives you following error , even transport.isConnected() returns true . So it means that password and username and other details are correct , and it is able to make a connection to smtp server , but still it is not able to send mail . &lt;/br&gt;&lt;/br&gt;

&lt;pre class="prettyprint lang-java"&gt;
javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
 com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1 &lt;javaroots.host[x.x.x.x.]&gt;: Client host rejected: Access denied

 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1607)
 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:887)
 at javax.mail.Transport.send0(Transport.java:191)
 at javax.mail.Transport.send(Transport.java:120)
 at com.services.RestServices.cancelManagerPicking(RestServices.java:2348)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:187)
 at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:71)
 at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:280)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1341)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1273)
 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223)
 at org.mule.module.jersey.JerseyResourcesComponent.doInvoke(JerseyResourcesComponent.java:159)
 at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:122)
 at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:57)
 at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:238)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)
 at org.mule.component.AbstractComponent.process(AbstractComponent.java:156)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:97)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:54)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:40)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)
 at org.mule.construct.AbstractPipeline$1.process(AbstractPipeline.java:109)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)
 at org.mule.construct.AbstractPipeline$3.process(AbstractPipeline.java:207)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.SimpleMessageProcessorChain.doProcess(SimpleMessageProcessorChain.java:43)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.SimpleMessageProcessorChain.doProcess(SimpleMessageProcessorChain.java:43)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)
 at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)
 at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
 at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
 at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
 at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)
 at org.mule.transport.AbstractMessageReceiver.routeEvent(AbstractMessageReceiver.java:511)
 at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:226)
 at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:208)
 at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:200)
 at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:187)
 at org.mule.transport.http.HttpMessageReceiver$HttpWorker$1.process(HttpMessageReceiver.java:311)
 at org.mule.transport.http.HttpMessageReceiver$HttpWorker$1.process(HttpMessageReceiver.java:306)
 at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
 at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
 at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
 at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
 at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
 at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
 at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
 at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
 at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
 at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
 at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
 at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)
 at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
 at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:305)
 at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:251)
 at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:163)
 at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
 at org.mule.work.WorkerContext.run(WorkerContext.java:286)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1 &lt;javaroots.host[x.x.x.x]&gt;: Client host rejected: Access denied
&lt;/pre&gt;
The reason for this error was that you did not starttls in your program .Adding the following line fix the error .
&lt;pre class="prettyprint lang-java"&gt;
props.put("mail.smtp.starttls.enable", "true");
&lt;/pre&gt;



&lt;br /&gt;&lt;/div&gt;</description></item><item><title>How to Create Documentation of JAX-RS Web Services</title><link>http://www.javaroots.com/2016/09/auto-generate-doc-from-java-webservice.html</link><category>CORE JAVA</category><category>MULE ESB</category><category>RAML</category><category>REST</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Sat, 10 Sep 2016 06:44:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-2313364832658447695</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this post i will describe how to create a html document from you rest jersey class , which can be used by web sevices consumers easily . &lt;/br&gt;&lt;/br&gt;

First you need to install &lt;a href="https://github.com/mulesoft/raml-for-jax-rs/blob/master/eclipseplugin.md" target="_blank"&gt;raml-for-jax-rs&lt;/a&gt; plugin in your eclipse or anypoint studio . &lt;/br&gt;&lt;/br&gt;

Once you start it properly , and go to your rest service JAX-RS class , and right click on it , you should be able to see "Generate raml for class" option . You click on it and provide name and location of your generated raml file . &lt;/br&gt;&lt;/br&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6sYlljxSLAhG7lfV1-qcTQ77ChRkgd4JgrwL0xZj_E2_dlfwgfKtq9GvYoqa-NP04f5DNws7crK3gNg4dGAmXLKbyVy-ANbyZpQY9EFowSnEK0d4wRkGCt__k2lODGHUPwNK4TQ8jjERI/s1600/rest_doc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6sYlljxSLAhG7lfV1-qcTQ77ChRkgd4JgrwL0xZj_E2_dlfwgfKtq9GvYoqa-NP04f5DNws7crK3gNg4dGAmXLKbyVy-ANbyZpQY9EFowSnEK0d4wRkGCt__k2lODGHUPwNK4TQ8jjERI/s320/rest_doc.png" width="320" height="180" /&gt;&lt;/a&gt;&lt;/div&gt;


Now you have your generated automatically by this awesome plugin , you need to convert it to html document . For that , you have to install &lt;a href="https://github.com/raml2html/raml2html"&gt; raml to html &lt;/a&gt; plugin which is written in node.js . install this plugin and go to the location where you have generated the raml file .Now you have to just use following command :
&lt;pre class="prettyprint lang-java"&gt;
raml2html RestServices.raml -o doc.html
&lt;/pre&gt;  
Now your rest class is converted in good looking one page html document which you can expose on your web server .

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig52dUXCKYog6-82AABhXIRF39rbVc5vx3iYp1osw4amgj3JnHbbUdarAx4VBjoA1ZYSPk3-fkcxT4o0BQVdTz9sxNHlqNLDRnMFRtiIATUYJIxqzOPhJozSIS-Rxo1vKEG3KxjGC5yH_J/s1600/ramlhtml.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig52dUXCKYog6-82AABhXIRF39rbVc5vx3iYp1osw4amgj3JnHbbUdarAx4VBjoA1ZYSPk3-fkcxT4o0BQVdTz9sxNHlqNLDRnMFRtiIATUYJIxqzOPhJozSIS-Rxo1vKEG3KxjGC5yH_J/s320/ramlhtml.png" width="320" height="160" /&gt;&lt;/a&gt;&lt;/div&gt;

  
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6sYlljxSLAhG7lfV1-qcTQ77ChRkgd4JgrwL0xZj_E2_dlfwgfKtq9GvYoqa-NP04f5DNws7crK3gNg4dGAmXLKbyVy-ANbyZpQY9EFowSnEK0d4wRkGCt__k2lODGHUPwNK4TQ8jjERI/s72-c/rest_doc.png" width="72"/></item><item><title>Download WebMaster Tool Data using Casper JS</title><link>http://www.javaroots.com/2016/08/download-webmaster-tool-data-automated-process.html</link><category>CasperJS</category><category>CORE JAVA</category><category>How To</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Fri, 12 Aug 2016 05:31:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5160313455234642713</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

This is a simple &lt;a href="http://casperjs.org/" target="_blank"&gt;casper js&lt;/a&gt; script to automate your process of downloading webmaster tools reports . &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

Google Webmaster does not provide any api to download the data . &lt;/br&gt;&lt;/br&gt;

This simple casperjs script will allow you to download the data and automate the process . &lt;/br&gt;&lt;/br&gt;

please change the google account credentials and also the time period for which you want to download the report . 

&lt;pre class="prettyprint lang-java"&gt;
var page = require('webpage').create();
var xpath = require('casper').selectXPath;
var casper = require('casper').create({   
    verbose: true, 
    logLevel: 'debug',
    pageSettings: {
         loadImages:  false,         // The WebPage instance used by Casper will
         loadPlugins: false,         // use these settings
         userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4'
    }
});

// print out all the messages in the headless browser context
casper.on('remote.message', function(msg) {
    this.echo('remote message caught: ' + msg);
});

// print out all the messages in the headless browser context
casper.on("page.error", function(msg, trace) {
    this.echo("Page Error: " + msg, "ERROR");
});

var url = 'https://accounts.google.com/ServiceLogin';

casper.start(url, function() {
   // search for 'casperjs' from google form
   console.log("page loaded");
   this.fill('form#gaia_loginform', { 
        Email:'test', 
        Passwd:'test'
    }, true);
});

casper.thenEvaluate(function(){
   console.log("Page Title " + document.title);
});
var url = 'https://www.google.com/webmasters/tools/top-search-queries?hl=en&amp;siteUrl=http://www.javaroots.com/&amp;de=20150315&amp;db=20150314&amp;more=true&amp;type=queries';
casper.thenOpen(url ,function (status) {
    /*var js = page.evaluate(function () {
        return document;
    });
    console.log(JSON.stringify(js)); */
 console.log(" trrsadsadsssssss");
});

casper.then(function() {
 console.log(" clickingggg first time ");
 this.click('#tsq-table-download &gt; div:nth-child(1)');
 //this.click(xpath('//*[@class="goog-inline-block jfk-button jfk-button-standard"]'));
});


//casper.waitForSelector(xpath('/html/body/div[11]/div[3]/button[1]'), function() {
 casper.waitForSelector('.goog-buttonset-default', function() {

casper.then(function(){
  this.capture('abc.png', undefined, {
             format: 'png',
            quality: 100
     });
});
});

casper.then(function() {
 console.log(" clickingggg");
 //this.click(xpath('/html/body/div[11]/div[3]'));
 this.click('.goog-buttonset-default');
});

casper.on('resource.received', function(resource) {
 if(resource.url)
 {
  if(resource.url.indexOf("/top-search-queries-dl") &gt; -1)
  {
   console.log(" resource url is " + resource.url);
   console.log("Downloading csv file");
   this.download(resource.url, 'ExportData.csv');
  }
 }
 
});
casper.run();
&lt;/pre&gt;

Post Comments and suggestions !!!! &lt;/br&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOC0KoS46ICyZw3irEwfHBTfhN9XZ0d5xsef5ap6ntP6Afg1rw-ynLhRlDAPbc7ODkBL5kM86TQBOs3VzUrI0rs4M9142DVr1h50xm6z58aLJVFxwMJixHLmZC5XtFMw2iVSFWCgqESTM5/s1600/javaee_duke_image.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOC0KoS46ICyZw3irEwfHBTfhN9XZ0d5xsef5ap6ntP6Afg1rw-ynLhRlDAPbc7ODkBL5kM86TQBOs3VzUrI0rs4M9142DVr1h50xm6z58aLJVFxwMJixHLmZC5XtFMw2iVSFWCgqESTM5/s320/javaee_duke_image.jpg" width="320" height="272" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOC0KoS46ICyZw3irEwfHBTfhN9XZ0d5xsef5ap6ntP6Afg1rw-ynLhRlDAPbc7ODkBL5kM86TQBOs3VzUrI0rs4M9142DVr1h50xm6z58aLJVFxwMJixHLmZC5XtFMw2iVSFWCgqESTM5/s72-c/javaee_duke_image.jpg" width="72"/></item><item><title>How to migrate from SVN to GIT repository</title><link>http://www.javaroots.com/2016/08/how-to-migrate-from-svn-to-git.html</link><category>GIT</category><category>SVN</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Thu, 4 Aug 2016 04:31:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-9007331950242100071</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This post describes step by step guide to migrate your svn repository to git repository.&lt;br /&gt;
First , lets have a look as why git is better than svn .&lt;br /&gt;
&lt;br /&gt;
1) GIT is distributed, SVN is not.&lt;br /&gt;
&amp;nbsp;2) GIT stores content as metadata, SVN stores just files.&lt;br /&gt;
3) GIT branches are not the same as SVN branches.&lt;br /&gt;
4) GIT does not have a global revision no. like SVN do.&lt;br /&gt;
5) GIT’s content integrity is better than SVN.


&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8WvcLnkhYEl7R2jMdWuZjl1OEStvG9uVXeN-6aRsLkc86QfjJkuWX86KRAfEPjO-KRBI3C-gKFv4f2ciu7LvE8_RXVzdWI6IwUUMTu66ZgMVlA7tPJfVCuZbRD2BLhEyIOw_kUziZvDjZ/s1600/svnTogitMigrate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8WvcLnkhYEl7R2jMdWuZjl1OEStvG9uVXeN-6aRsLkc86QfjJkuWX86KRAfEPjO-KRBI3C-gKFv4f2ciu7LvE8_RXVzdWI6IwUUMTu66ZgMVlA7tPJfVCuZbRD2BLhEyIOw_kUziZvDjZ/s320/svnTogitMigrate.png" width="320" height="213" /&gt;&lt;/a&gt;&lt;/div&gt;
Now we see the different structures of both these .&lt;/br&gt;

SVN : &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;
 -&gt;Trunk&lt;/br&gt;
 -&gt;Branches&lt;/br&gt;
 -&gt;Tags&lt;/br&gt;
 -&gt;Extra DIR&lt;/br&gt;
&lt;/br&gt;&lt;/br&gt;
GIT: &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;
 -&gt;Single Working Directory&lt;/br&gt;
.git directory stores binary format of branches , tags and other details.&lt;/br&gt;&lt;/br&gt;

Steps:&lt;/br&gt;&lt;/br&gt;

&lt;pre class="prettyprint lang-java"&gt;1. Download Subgit from above link
2. Make Sure you have java version &gt;= 1.7
3. Note Down the SVN URL &amp; Git Remotes
4. Extract the Downloaded archive.
5. Execute the below Commands
6. ~/Softwares/subgit-3.2.0/bin/subgit configure --layout auto https://svn.xysys.net/svn/dynamic-feed-server/projects/dsc dsc.git
7. The above command will detect the latest revision , history , branches, tags and configure authors.
8.  Once Done execute
9.  ~/Softwares/subgit-3.2.0/bin/subgit install dsc.git/  This would take some time depending on the revisions and the no of time file got modified to convert revision to git commits. Have Patience.
10. git clone dsc.git
11. This Would create your dsc git project with all tags , branches etc…
12. cd dsc &amp;&amp; git branch –ar would list all the branches. You can also use git log to see the revisions converted to GIT Commits.
13. IMP:  git remote –v would saw you locat path which need to be changed to GIT Remote.
14. In mycase : In file .git/config , url = /Users/mohantysan/workspace/GitMigration/dsc.git 
We need to Change it to Git URL else if you make any commits and push it will push to SVN REPO.
&lt;/pre&gt; 

&lt;pre class="prettyprint lang-java"&gt;
Change the url to something like this :
url = git@github.com/ae/dsc.git
Now Your SVN Repo is Converted and ready to be published.
 git push origin –all # will push your code with all svn converted revision to GIT and you can use it as usual.
For Publishing Branches and Tags checkout branches and tags locally and push 
&lt;/pre&gt;

Happy Migration , Thank You &lt;/br&gt;&lt;/br&gt;

This post is created by &lt;b&gt;Santosh Mohanty&lt;/b&gt; . You can contact him for any questions at &lt;b&gt;santa.jyp@gmail.com&lt;/b&gt; or message him on his &lt;a href="https://in.linkedin.com/in/mumu1987" target="_blank"&gt;linkedIn profile&lt;/a&gt; .&lt;/br&gt;&lt;/br&gt;




&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8WvcLnkhYEl7R2jMdWuZjl1OEStvG9uVXeN-6aRsLkc86QfjJkuWX86KRAfEPjO-KRBI3C-gKFv4f2ciu7LvE8_RXVzdWI6IwUUMTu66ZgMVlA7tPJfVCuZbRD2BLhEyIOw_kUziZvDjZ/s72-c/svnTogitMigrate.png" width="72"/></item><item><title>Jav 8 FlatMap Explained Stream API  </title><link>http://www.javaroots.com/2016/07/jav-8-flatmap-explained-stream-api.html</link><category>JAVA 8</category><category>STREAM</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Fri, 8 Jul 2016 04:39:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-7821396880888577388</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

In this short example , i will explain where we can use flatMap function of java stream api . &lt;/br&gt;&lt;/br&gt;


Suppose you have a multi level list where many objects are stored , and you want to convert it to a single list of objects . We can use flatmap which will flatten the list easily . &lt;/br&gt;&lt;/br&gt;

FlatMap basically first applies the transformation , and then then flatten the result in a single collection . &lt;/br&gt;&lt;/br&gt;


&lt;pre class="prettyprint lang-java"&gt;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created by abhishek.somani on 8/7/16.
 */
public class JavarootsFlatMapExample {

    public static void main(String[] args) {
        String[] arr = {&amp;quot;abhishekl&amp;quot;,&amp;quot;somani&amp;quot;};
        String[] arr2 = {&amp;quot;java&amp;quot;,&amp;quot;example&amp;quot;,&amp;quot;1.8&amp;quot;,&amp;quot;stream&amp;quot;};
        List&amp;lt;List&amp;lt;String&amp;gt;&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();
        list.add(Arrays.asList(arr));
        list.add(Arrays.asList(arr2));
        final List&amp;lt;String&amp;gt; strings = list.stream().flatMap(l -&amp;gt; l.stream()).collect(Collectors.toList());
        System.out.println(strings);
    }

}
&lt;/pre&gt;

Post Comments And Suggestions !!!


&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhskK_gLQUtxL-Mj3TPv_7iXjJ8Yv3kElO57Fe9Rt5ShzslWoE3tk8X0aeZxSNXrPpOw3ZYIcOeupua9wBztLHv6Ew0gp6sfBY_3BtQMlbxbo9DL8Qmpe0c_zzEnVlD7bJEUy5ChjpQfUK4/s1600/javaee_duke_image.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhskK_gLQUtxL-Mj3TPv_7iXjJ8Yv3kElO57Fe9Rt5ShzslWoE3tk8X0aeZxSNXrPpOw3ZYIcOeupua9wBztLHv6Ew0gp6sfBY_3BtQMlbxbo9DL8Qmpe0c_zzEnVlD7bJEUy5ChjpQfUK4/s320/javaee_duke_image.jpg" width="320" height="272" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhskK_gLQUtxL-Mj3TPv_7iXjJ8Yv3kElO57Fe9Rt5ShzslWoE3tk8X0aeZxSNXrPpOw3ZYIcOeupua9wBztLHv6Ew0gp6sfBY_3BtQMlbxbo9DL8Qmpe0c_zzEnVlD7bJEUy5ChjpQfUK4/s72-c/javaee_duke_image.jpg" width="72"/></item><item><title>Mule HttpListener Example </title><link>http://www.javaroots.com/2016/04/mule-httplistener-example.html</link><category>MULE ESB</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Tue, 5 Apr 2016 05:09:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-2817557990488532388</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Mule Runtime 3.6 and later version have deprecated old Http Connector with , new Http Listener Config . Let's take an example to see how we can use it .This example also demonstrates how to get a particular xml element without using JAXB . &lt;/br&gt;&lt;/br&gt;

This example app will listen to a particular host and port , for post method , and parses the request xml using xpath . Based on the xml , we return the response based on the input xml received in request .&lt;/br&gt;&lt;/br&gt; 

This is our mule config xml :
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;

&amp;lt;mule xmlns:http=&amp;quot;http://www.mulesoft.org/schema/mule/http&amp;quot; xmlns=&amp;quot;http://www.mulesoft.org/schema/mule/core&amp;quot; xmlns:doc=&amp;quot;http://www.mulesoft.org/schema/mule/documentation&amp;quot;
 xmlns:spring=&amp;quot;http://www.springframework.org/schema/beans&amp;quot; version=&amp;quot;CE-3.6.1&amp;quot;
 xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
 xsi:schemaLocation=&amp;quot;http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd&amp;quot;&amp;gt;

&amp;lt;http:listener-config port=&amp;quot;8081&amp;quot; host=&amp;quot;0.0.0.0&amp;quot; name=&amp;quot;myRequestConfig&amp;quot; &amp;gt;
 &amp;lt;http:worker-threading-profile maxThreadsActive=&amp;quot;15&amp;quot;/&amp;gt;
&amp;lt;/http:listener-config&amp;gt;

&amp;lt;flow name=&amp;quot;SimpleTest&amp;quot; &amp;gt;
&amp;lt;http:listener path=&amp;quot;/abc&amp;quot; config-ref=&amp;quot;myRequestConfig&amp;quot; allowedMethods=&amp;quot;PATCH&amp;quot;/&amp;gt;
&amp;lt;logger category=&amp;quot;d&amp;quot; level=&amp;quot;ERROR&amp;quot; message=&amp;quot;xpath: #[xpath3('/isCancelled')]&amp;quot;/&amp;gt;

&amp;lt;choice &amp;gt;
&amp;lt;when expression=&amp;quot;#[xpath3('/isCancelled') == 'true']&amp;quot;&amp;gt;
 &amp;lt;set-payload value=&amp;quot;SUCCESSS&amp;quot;&amp;gt;&amp;lt;/set-payload&amp;gt;
&amp;lt;/when&amp;gt;
&amp;lt;otherwise&amp;gt;
 &amp;lt;set-payload value=&amp;quot;FAIL&amp;quot;&amp;gt;&amp;lt;/set-payload&amp;gt;
&amp;lt;/otherwise&amp;gt;
&amp;lt;/choice&amp;gt;
&amp;lt;/flow&amp;gt;

&amp;lt;/mule&amp;gt;
&lt;/pre&gt;
Now we can see that traditional http inbound endpoint and http connector is replaced with Http Listener and Http Listener Config respectively . The major difference is that we can not use service overrides in Http listener config like we used to do in http connector , also http listener does not return MULE_SESSION in response headers .If we use http listener , all outbound property will automatically be converted in http response headers . You can use allowedMethods attribute to configure different Http methods . We can have multiple http listener , referencing to same listener config . Multiple flows with same path but different methods is also allowed . &lt;/br&gt;&lt;/br&gt;

Post Comments And Suggestions .!!!&lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKLi669Kj5NXYeDRl7TKLf3u_0bNAZgLizzcpn0J5TnR8vaJGoVe_ARR11pIB1fCkrfur7IPJ8DDap39Uy2ki4xyDkcJ1ZmyTGqAkj8hySjROq4cEhltpK8LwnV1xnIZwSWrCOHC4pKcZs/s1600/mule_logo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKLi669Kj5NXYeDRl7TKLf3u_0bNAZgLizzcpn0J5TnR8vaJGoVe_ARR11pIB1fCkrfur7IPJ8DDap39Uy2ki4xyDkcJ1ZmyTGqAkj8hySjROq4cEhltpK8LwnV1xnIZwSWrCOHC4pKcZs/s320/mule_logo.png" /&gt;&lt;/a&gt;&lt;/div&gt; 

&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKLi669Kj5NXYeDRl7TKLf3u_0bNAZgLizzcpn0J5TnR8vaJGoVe_ARR11pIB1fCkrfur7IPJ8DDap39Uy2ki4xyDkcJ1ZmyTGqAkj8hySjROq4cEhltpK8LwnV1xnIZwSWrCOHC4pKcZs/s72-c/mule_logo.png" width="72"/></item><item><title>How to Generate Barcode 128 In Java</title><link>http://www.javaroots.com/2015/12/how-to-generate-barcode-128-in-java.html</link><category>CORE JAVA</category><category>How To</category><author>noreply@blogger.com (Abhishek)</author><pubDate>Wed, 9 Dec 2015 02:13:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7601503495596097717.post-5632012724405485431</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
For generating Barcodes , we can use &lt;a href="http://barcode4j.sourceforge.net/" target="_blank"&gt;Barcode4j &lt;/a&gt; library , which is opensource and free library . Let's look at some java code to generate barcode as image in java .&lt;/br&gt;&lt;/br&gt;
First of all , enter following dependency in your pom.xml.
&lt;pre class="prettyprint lang-java"&gt;
&amp;lt;dependency&amp;gt;
 &amp;lt;groupId&amp;gt;net.sf.barcode4j&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;barcode4j&amp;lt;/artifactId&amp;gt;
 &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;
   
   &amp;lt;/dependency&amp;gt;

&lt;/pre&gt;
You can also download the jar from &lt;a href="http://sourceforge.net/projects/barcode4j/files/" target="_blank"&gt;here &lt;/a&gt;if you are using it in a standalone java program .&lt;/br&gt;&lt;/br&gt;

Now here is the sample java program which generates the barcode 128 with codeset B and save it as a png file.
&lt;pre class="prettyprint lang-java"&gt;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.krysalis.barcode4j.impl.code128.Code128Bean;
import org.krysalis.barcode4j.impl.code128.Code128Constants;
import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider;
import org.krysalis.barcode4j.tools.UnitConv;


public class MainClass2 {
  
  public static void main(String[] args) throws IOException {
    
    String barcodeString = "4888575";
    Code128Bean barcode128Bean = new Code128Bean();
    
    
    barcode128Bean.setCodeset(Code128Constants.CODESET_B);
    final int dpi = 100;

  //Configure the barcode generator
    //adjust barcode width here
  barcode128Bean.setModuleWidth(UnitConv.in2mm(5.0f / dpi)); 
  barcode128Bean.doQuietZone(false);

  //Open output file
  File outputFile = new File("G:/barcode.png");
  OutputStream out = new FileOutputStream(outputFile);
  try 
  {
      BitmapCanvasProvider canvasProvider = new BitmapCanvasProvider(
              out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0);

      barcode128Bean.generateBarcode(canvasProvider,barcodeString);

      canvasProvider.finish();
  } 
  finally 
  {
      out.close();
  }
    
  }

}

&lt;/pre&gt;
Barcode4J supports other formats like EAN-128, GS1-128 , Code 39 etc as well . &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;

Provide comments and suggestions !!! &lt;/br&gt;&lt;/br&gt;&lt;/br&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiNN1tvbOMJw_BhNQsgdXccPdGhCundUk3mHFYCi7B5_mmNI7R3xDI33sfyGsF7I3UB3EypdZgrC1qIiQr1khaqIZ1bo2GullO44pA7Lg2C5h1ghHcg3RzX4nNm372Nu8CoqTcJPN6_yTN/s1600/javaee_duke_image.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiNN1tvbOMJw_BhNQsgdXccPdGhCundUk3mHFYCi7B5_mmNI7R3xDI33sfyGsF7I3UB3EypdZgrC1qIiQr1khaqIZ1bo2GullO44pA7Lg2C5h1ghHcg3RzX4nNm372Nu8CoqTcJPN6_yTN/s320/javaee_duke_image.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiNN1tvbOMJw_BhNQsgdXccPdGhCundUk3mHFYCi7B5_mmNI7R3xDI33sfyGsF7I3UB3EypdZgrC1qIiQr1khaqIZ1bo2GullO44pA7Lg2C5h1ghHcg3RzX4nNm372Nu8CoqTcJPN6_yTN/s72-c/javaee_duke_image.jpg" width="72"/></item></channel></rss>