commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r952406 [14/42] - in /websites/production/commons/content/proper/commons-email: ./ apidocs/ apidocs/org/apache/commons/mail/ apidocs/org/apache/commons/mail/class-use/ apidocs/org/apache/commons/mail/resolver/ apidocs/org/apache/commons/mai...
Date Sat, 23 May 2015 06:51:00 GMT
Modified: websites/production/commons/content/proper/commons-email/apidocs/src-html/org/apache/commons/mail/Email.html
==============================================================================
--- websites/production/commons/content/proper/commons-email/apidocs/src-html/org/apache/commons/mail/Email.html (original)
+++ websites/production/commons/content/proper/commons-email/apidocs/src-html/org/apache/commons/mail/Email.html Sat May 23 06:50:57 2015
@@ -57,7 +57,7 @@
 <span class="sourceLineNo">049</span> * Subclasses are responsible for setting the message body.<a name="line.49"></a>
 <span class="sourceLineNo">050</span> *<a name="line.50"></a>
 <span class="sourceLineNo">051</span> * @since 1.0<a name="line.51"></a>
-<span class="sourceLineNo">052</span> * @version $Id: Email.java 1606709 2014-06-30 12:26:06Z ggregory $<a name="line.52"></a>
+<span class="sourceLineNo">052</span> * @version $Id: Email.java 1665699 2015-03-10 21:12:09Z tn $<a name="line.52"></a>
 <span class="sourceLineNo">053</span> */<a name="line.53"></a>
 <span class="sourceLineNo">054</span>public abstract class Email<a name="line.54"></a>
 <span class="sourceLineNo">055</span>{<a name="line.55"></a>
@@ -1223,721 +1223,732 @@
 <span class="sourceLineNo">1215</span>    }<a name="line.1215"></a>
 <span class="sourceLineNo">1216</span><a name="line.1216"></a>
 <span class="sourceLineNo">1217</span>    /**<a name="line.1217"></a>
-<span class="sourceLineNo">1218</span>     * Set the "bounce address" - the address to which undeliverable messages<a name="line.1218"></a>
-<span class="sourceLineNo">1219</span>     * will be returned.  If this value is never set, then the message will be<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span>     * sent to the address specified with the System property "mail.smtp.from",<a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>     * or if that value is not set, then to the "from" address.<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>     *<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span>     * @param email A String.<a name="line.1223"></a>
-<span class="sourceLineNo">1224</span>     * @return An Email.<a name="line.1224"></a>
-<span class="sourceLineNo">1225</span>     * @throws IllegalStateException when the mail session is already initialized<a name="line.1225"></a>
-<span class="sourceLineNo">1226</span>     * @since 1.0<a name="line.1226"></a>
-<span class="sourceLineNo">1227</span>     */<a name="line.1227"></a>
-<span class="sourceLineNo">1228</span>    public Email setBounceAddress(final String email)<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span>    {<a name="line.1229"></a>
-<span class="sourceLineNo">1230</span>        checkSessionAlreadyInitialized();<a name="line.1230"></a>
-<span class="sourceLineNo">1231</span>        this.bounceAddress = email;<a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>        return this;<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>    }<a name="line.1233"></a>
-<span class="sourceLineNo">1234</span><a name="line.1234"></a>
-<span class="sourceLineNo">1235</span><a name="line.1235"></a>
-<span class="sourceLineNo">1236</span>    /**<a name="line.1236"></a>
-<span class="sourceLineNo">1237</span>     * Define the content of the mail. It should be overridden by the<a name="line.1237"></a>
-<span class="sourceLineNo">1238</span>     * subclasses.<a name="line.1238"></a>
-<span class="sourceLineNo">1239</span>     *<a name="line.1239"></a>
-<span class="sourceLineNo">1240</span>     * @param msg A String.<a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>     * @return An Email.<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span>     * @throws EmailException generic exception.<a name="line.1242"></a>
-<span class="sourceLineNo">1243</span>     * @since 1.0<a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>     */<a name="line.1244"></a>
-<span class="sourceLineNo">1245</span>    public abstract Email setMsg(String msg) throws EmailException;<a name="line.1245"></a>
-<span class="sourceLineNo">1246</span><a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>    /**<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>     * Does the work of actually building the MimeMessage. Please note that<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span>     * a user rarely calls this method directly and only if he/she is<a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>     * interested in the sending the underlying MimeMessage without<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span>     * commons-email.<a name="line.1251"></a>
-<span class="sourceLineNo">1252</span>     *<a name="line.1252"></a>
-<span class="sourceLineNo">1253</span>     * @throws IllegalStateException if the MimeMessage was already built<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>     * @throws EmailException if there was an error.<a name="line.1254"></a>
-<span class="sourceLineNo">1255</span>     * @since 1.0<a name="line.1255"></a>
-<span class="sourceLineNo">1256</span>     */<a name="line.1256"></a>
-<span class="sourceLineNo">1257</span>    public void buildMimeMessage() throws EmailException<a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>    {<a name="line.1258"></a>
-<span class="sourceLineNo">1259</span>        if (this.message != null)<a name="line.1259"></a>
-<span class="sourceLineNo">1260</span>        {<a name="line.1260"></a>
-<span class="sourceLineNo">1261</span>            // [EMAIL-95] we assume that an email is not reused therefore invoking<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span>            // buildMimeMessage() more than once is illegal.<a name="line.1262"></a>
-<span class="sourceLineNo">1263</span>            throw new IllegalStateException("The MimeMessage is already built.");<a name="line.1263"></a>
-<span class="sourceLineNo">1264</span>        }<a name="line.1264"></a>
-<span class="sourceLineNo">1265</span><a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>        try<a name="line.1266"></a>
-<span class="sourceLineNo">1267</span>        {<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span>            this.message = this.createMimeMessage(this.getMailSession());<a name="line.1268"></a>
-<span class="sourceLineNo">1269</span><a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>            if (EmailUtils.isNotEmpty(this.subject))<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>            {<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>                if (EmailUtils.isNotEmpty(this.charset))<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>                {<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>                    this.message.setSubject(this.subject, this.charset);<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>                }<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>                else<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>                {<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>                    this.message.setSubject(this.subject);<a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>                }<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>            }<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span><a name="line.1281"></a>
-<span class="sourceLineNo">1282</span>            // update content type (and encoding)<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>            this.updateContentType(this.contentType);<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span><a name="line.1284"></a>
-<span class="sourceLineNo">1285</span>            if (this.content != null)<a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>            {<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>                if (EmailConstants.TEXT_PLAIN.equalsIgnoreCase(this.contentType)<a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>                        &amp;&amp; this.content instanceof String)<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>                {<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>                    // EMAIL-104: call explicitly setText to use default mime charset<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>                    //            (property "mail.mime.charset") in case none has been set<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span>                    this.message.setText(this.content.toString(), this.charset);<a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>                }<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>                else<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>                {<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span>                    this.message.setContent(this.content, this.contentType);<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>                }<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span>            }<a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>            else if (this.emailBody != null)<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>            {<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span>                if (this.contentType == null)<a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>                {<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>                    this.message.setContent(this.emailBody);<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>                }<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>                else<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>                {<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>                    this.message.setContent(this.emailBody, this.contentType);<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>                }<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>            }<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>            else<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>            {<a name="line.1311"></a>
-<span class="sourceLineNo">1312</span>                this.message.setText("");<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>            }<a name="line.1313"></a>
-<span class="sourceLineNo">1314</span><a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>            if (this.fromAddress != null)<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>            {<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>                this.message.setFrom(this.fromAddress);<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>            }<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>            else<a name="line.1319"></a>
-<span class="sourceLineNo">1320</span>            {<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span>                if (session.getProperty(MAIL_SMTP_FROM) == null)<a name="line.1321"></a>
-<span class="sourceLineNo">1322</span>                {<a name="line.1322"></a>
-<span class="sourceLineNo">1323</span>                    throw new EmailException("From address required");<a name="line.1323"></a>
-<span class="sourceLineNo">1324</span>                }<a name="line.1324"></a>
-<span class="sourceLineNo">1325</span>            }<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span><a name="line.1326"></a>
-<span class="sourceLineNo">1327</span>            if (this.toList.size() + this.ccList.size() + this.bccList.size() == 0)<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>            {<a name="line.1328"></a>
-<span class="sourceLineNo">1329</span>                throw new EmailException("At least one receiver address required");<a name="line.1329"></a>
-<span class="sourceLineNo">1330</span>            }<a name="line.1330"></a>
-<span class="sourceLineNo">1331</span><a name="line.1331"></a>
-<span class="sourceLineNo">1332</span>            if (this.toList.size() &gt; 0)<a name="line.1332"></a>
-<span class="sourceLineNo">1333</span>            {<a name="line.1333"></a>
-<span class="sourceLineNo">1334</span>                this.message.setRecipients(<a name="line.1334"></a>
-<span class="sourceLineNo">1335</span>                    Message.RecipientType.TO,<a name="line.1335"></a>
-<span class="sourceLineNo">1336</span>                    this.toInternetAddressArray(this.toList));<a name="line.1336"></a>
-<span class="sourceLineNo">1337</span>            }<a name="line.1337"></a>
-<span class="sourceLineNo">1338</span><a name="line.1338"></a>
-<span class="sourceLineNo">1339</span>            if (this.ccList.size() &gt; 0)<a name="line.1339"></a>
-<span class="sourceLineNo">1340</span>            {<a name="line.1340"></a>
-<span class="sourceLineNo">1341</span>                this.message.setRecipients(<a name="line.1341"></a>
-<span class="sourceLineNo">1342</span>                    Message.RecipientType.CC,<a name="line.1342"></a>
-<span class="sourceLineNo">1343</span>                    this.toInternetAddressArray(this.ccList));<a name="line.1343"></a>
-<span class="sourceLineNo">1344</span>            }<a name="line.1344"></a>
-<span class="sourceLineNo">1345</span><a name="line.1345"></a>
-<span class="sourceLineNo">1346</span>            if (this.bccList.size() &gt; 0)<a name="line.1346"></a>
-<span class="sourceLineNo">1347</span>            {<a name="line.1347"></a>
-<span class="sourceLineNo">1348</span>                this.message.setRecipients(<a name="line.1348"></a>
-<span class="sourceLineNo">1349</span>                    Message.RecipientType.BCC,<a name="line.1349"></a>
-<span class="sourceLineNo">1350</span>                    this.toInternetAddressArray(this.bccList));<a name="line.1350"></a>
-<span class="sourceLineNo">1351</span>            }<a name="line.1351"></a>
-<span class="sourceLineNo">1352</span><a name="line.1352"></a>
-<span class="sourceLineNo">1353</span>            if (this.replyList.size() &gt; 0)<a name="line.1353"></a>
-<span class="sourceLineNo">1354</span>            {<a name="line.1354"></a>
-<span class="sourceLineNo">1355</span>                this.message.setReplyTo(<a name="line.1355"></a>
-<span class="sourceLineNo">1356</span>                    this.toInternetAddressArray(this.replyList));<a name="line.1356"></a>
-<span class="sourceLineNo">1357</span>            }<a name="line.1357"></a>
-<span class="sourceLineNo">1358</span><a name="line.1358"></a>
-<span class="sourceLineNo">1359</span><a name="line.1359"></a>
-<span class="sourceLineNo">1360</span>            if (this.headers.size() &gt; 0)<a name="line.1360"></a>
-<span class="sourceLineNo">1361</span>            {<a name="line.1361"></a>
-<span class="sourceLineNo">1362</span>                for (final Map.Entry&lt;String, String&gt; entry : this.headers.entrySet())<a name="line.1362"></a>
-<span class="sourceLineNo">1363</span>                {<a name="line.1363"></a>
-<span class="sourceLineNo">1364</span>                    final String foldedValue = createFoldedHeaderValue(entry.getKey(), entry.getValue());<a name="line.1364"></a>
-<span class="sourceLineNo">1365</span>                    this.message.addHeader(entry.getKey(), foldedValue);<a name="line.1365"></a>
-<span class="sourceLineNo">1366</span>                }<a name="line.1366"></a>
-<span class="sourceLineNo">1367</span>            }<a name="line.1367"></a>
-<span class="sourceLineNo">1368</span><a name="line.1368"></a>
-<span class="sourceLineNo">1369</span>            if (this.message.getSentDate() == null)<a name="line.1369"></a>
-<span class="sourceLineNo">1370</span>            {<a name="line.1370"></a>
-<span class="sourceLineNo">1371</span>                this.message.setSentDate(getSentDate());<a name="line.1371"></a>
-<span class="sourceLineNo">1372</span>            }<a name="line.1372"></a>
-<span class="sourceLineNo">1373</span><a name="line.1373"></a>
-<span class="sourceLineNo">1374</span>            if (this.popBeforeSmtp)<a name="line.1374"></a>
-<span class="sourceLineNo">1375</span>            {<a name="line.1375"></a>
-<span class="sourceLineNo">1376</span>                final Store store = session.getStore("pop3");<a name="line.1376"></a>
-<span class="sourceLineNo">1377</span>                store.connect(this.popHost, this.popUsername, this.popPassword);<a name="line.1377"></a>
+<span class="sourceLineNo">1218</span>     * Gets the "bounce address" of this email.<a name="line.1218"></a>
+<span class="sourceLineNo">1219</span>     *<a name="line.1219"></a>
+<span class="sourceLineNo">1220</span>     * @return the bounce address as string<a name="line.1220"></a>
+<span class="sourceLineNo">1221</span>     * @since 1.4<a name="line.1221"></a>
+<span class="sourceLineNo">1222</span>     */<a name="line.1222"></a>
+<span class="sourceLineNo">1223</span>    public String getBounceAddress()<a name="line.1223"></a>
+<span class="sourceLineNo">1224</span>    {<a name="line.1224"></a>
+<span class="sourceLineNo">1225</span>        return this.bounceAddress;<a name="line.1225"></a>
+<span class="sourceLineNo">1226</span>    }<a name="line.1226"></a>
+<span class="sourceLineNo">1227</span><a name="line.1227"></a>
+<span class="sourceLineNo">1228</span>    /**<a name="line.1228"></a>
+<span class="sourceLineNo">1229</span>     * Set the "bounce address" - the address to which undeliverable messages<a name="line.1229"></a>
+<span class="sourceLineNo">1230</span>     * will be returned.  If this value is never set, then the message will be<a name="line.1230"></a>
+<span class="sourceLineNo">1231</span>     * sent to the address specified with the System property "mail.smtp.from",<a name="line.1231"></a>
+<span class="sourceLineNo">1232</span>     * or if that value is not set, then to the "from" address.<a name="line.1232"></a>
+<span class="sourceLineNo">1233</span>     *<a name="line.1233"></a>
+<span class="sourceLineNo">1234</span>     * @param email A String.<a name="line.1234"></a>
+<span class="sourceLineNo">1235</span>     * @return An Email.<a name="line.1235"></a>
+<span class="sourceLineNo">1236</span>     * @throws IllegalStateException when the mail session is already initialized<a name="line.1236"></a>
+<span class="sourceLineNo">1237</span>     * @since 1.0<a name="line.1237"></a>
+<span class="sourceLineNo">1238</span>     */<a name="line.1238"></a>
+<span class="sourceLineNo">1239</span>    public Email setBounceAddress(final String email)<a name="line.1239"></a>
+<span class="sourceLineNo">1240</span>    {<a name="line.1240"></a>
+<span class="sourceLineNo">1241</span>        checkSessionAlreadyInitialized();<a name="line.1241"></a>
+<span class="sourceLineNo">1242</span>        this.bounceAddress = email;<a name="line.1242"></a>
+<span class="sourceLineNo">1243</span>        return this;<a name="line.1243"></a>
+<span class="sourceLineNo">1244</span>    }<a name="line.1244"></a>
+<span class="sourceLineNo">1245</span><a name="line.1245"></a>
+<span class="sourceLineNo">1246</span>    /**<a name="line.1246"></a>
+<span class="sourceLineNo">1247</span>     * Define the content of the mail. It should be overridden by the<a name="line.1247"></a>
+<span class="sourceLineNo">1248</span>     * subclasses.<a name="line.1248"></a>
+<span class="sourceLineNo">1249</span>     *<a name="line.1249"></a>
+<span class="sourceLineNo">1250</span>     * @param msg A String.<a name="line.1250"></a>
+<span class="sourceLineNo">1251</span>     * @return An Email.<a name="line.1251"></a>
+<span class="sourceLineNo">1252</span>     * @throws EmailException generic exception.<a name="line.1252"></a>
+<span class="sourceLineNo">1253</span>     * @since 1.0<a name="line.1253"></a>
+<span class="sourceLineNo">1254</span>     */<a name="line.1254"></a>
+<span class="sourceLineNo">1255</span>    public abstract Email setMsg(String msg) throws EmailException;<a name="line.1255"></a>
+<span class="sourceLineNo">1256</span><a name="line.1256"></a>
+<span class="sourceLineNo">1257</span>    /**<a name="line.1257"></a>
+<span class="sourceLineNo">1258</span>     * Does the work of actually building the MimeMessage. Please note that<a name="line.1258"></a>
+<span class="sourceLineNo">1259</span>     * a user rarely calls this method directly and only if he/she is<a name="line.1259"></a>
+<span class="sourceLineNo">1260</span>     * interested in the sending the underlying MimeMessage without<a name="line.1260"></a>
+<span class="sourceLineNo">1261</span>     * commons-email.<a name="line.1261"></a>
+<span class="sourceLineNo">1262</span>     *<a name="line.1262"></a>
+<span class="sourceLineNo">1263</span>     * @throws IllegalStateException if the MimeMessage was already built<a name="line.1263"></a>
+<span class="sourceLineNo">1264</span>     * @throws EmailException if there was an error.<a name="line.1264"></a>
+<span class="sourceLineNo">1265</span>     * @since 1.0<a name="line.1265"></a>
+<span class="sourceLineNo">1266</span>     */<a name="line.1266"></a>
+<span class="sourceLineNo">1267</span>    public void buildMimeMessage() throws EmailException<a name="line.1267"></a>
+<span class="sourceLineNo">1268</span>    {<a name="line.1268"></a>
+<span class="sourceLineNo">1269</span>        if (this.message != null)<a name="line.1269"></a>
+<span class="sourceLineNo">1270</span>        {<a name="line.1270"></a>
+<span class="sourceLineNo">1271</span>            // [EMAIL-95] we assume that an email is not reused therefore invoking<a name="line.1271"></a>
+<span class="sourceLineNo">1272</span>            // buildMimeMessage() more than once is illegal.<a name="line.1272"></a>
+<span class="sourceLineNo">1273</span>            throw new IllegalStateException("The MimeMessage is already built.");<a name="line.1273"></a>
+<span class="sourceLineNo">1274</span>        }<a name="line.1274"></a>
+<span class="sourceLineNo">1275</span><a name="line.1275"></a>
+<span class="sourceLineNo">1276</span>        try<a name="line.1276"></a>
+<span class="sourceLineNo">1277</span>        {<a name="line.1277"></a>
+<span class="sourceLineNo">1278</span>            this.message = this.createMimeMessage(this.getMailSession());<a name="line.1278"></a>
+<span class="sourceLineNo">1279</span><a name="line.1279"></a>
+<span class="sourceLineNo">1280</span>            if (EmailUtils.isNotEmpty(this.subject))<a name="line.1280"></a>
+<span class="sourceLineNo">1281</span>            {<a name="line.1281"></a>
+<span class="sourceLineNo">1282</span>                if (EmailUtils.isNotEmpty(this.charset))<a name="line.1282"></a>
+<span class="sourceLineNo">1283</span>                {<a name="line.1283"></a>
+<span class="sourceLineNo">1284</span>                    this.message.setSubject(this.subject, this.charset);<a name="line.1284"></a>
+<span class="sourceLineNo">1285</span>                }<a name="line.1285"></a>
+<span class="sourceLineNo">1286</span>                else<a name="line.1286"></a>
+<span class="sourceLineNo">1287</span>                {<a name="line.1287"></a>
+<span class="sourceLineNo">1288</span>                    this.message.setSubject(this.subject);<a name="line.1288"></a>
+<span class="sourceLineNo">1289</span>                }<a name="line.1289"></a>
+<span class="sourceLineNo">1290</span>            }<a name="line.1290"></a>
+<span class="sourceLineNo">1291</span><a name="line.1291"></a>
+<span class="sourceLineNo">1292</span>            // update content type (and encoding)<a name="line.1292"></a>
+<span class="sourceLineNo">1293</span>            this.updateContentType(this.contentType);<a name="line.1293"></a>
+<span class="sourceLineNo">1294</span><a name="line.1294"></a>
+<span class="sourceLineNo">1295</span>            if (this.content != null)<a name="line.1295"></a>
+<span class="sourceLineNo">1296</span>            {<a name="line.1296"></a>
+<span class="sourceLineNo">1297</span>                if (EmailConstants.TEXT_PLAIN.equalsIgnoreCase(this.contentType)<a name="line.1297"></a>
+<span class="sourceLineNo">1298</span>                        &amp;&amp; this.content instanceof String)<a name="line.1298"></a>
+<span class="sourceLineNo">1299</span>                {<a name="line.1299"></a>
+<span class="sourceLineNo">1300</span>                    // EMAIL-104: call explicitly setText to use default mime charset<a name="line.1300"></a>
+<span class="sourceLineNo">1301</span>                    //            (property "mail.mime.charset") in case none has been set<a name="line.1301"></a>
+<span class="sourceLineNo">1302</span>                    this.message.setText(this.content.toString(), this.charset);<a name="line.1302"></a>
+<span class="sourceLineNo">1303</span>                }<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span>                else<a name="line.1304"></a>
+<span class="sourceLineNo">1305</span>                {<a name="line.1305"></a>
+<span class="sourceLineNo">1306</span>                    this.message.setContent(this.content, this.contentType);<a name="line.1306"></a>
+<span class="sourceLineNo">1307</span>                }<a name="line.1307"></a>
+<span class="sourceLineNo">1308</span>            }<a name="line.1308"></a>
+<span class="sourceLineNo">1309</span>            else if (this.emailBody != null)<a name="line.1309"></a>
+<span class="sourceLineNo">1310</span>            {<a name="line.1310"></a>
+<span class="sourceLineNo">1311</span>                if (this.contentType == null)<a name="line.1311"></a>
+<span class="sourceLineNo">1312</span>                {<a name="line.1312"></a>
+<span class="sourceLineNo">1313</span>                    this.message.setContent(this.emailBody);<a name="line.1313"></a>
+<span class="sourceLineNo">1314</span>                }<a name="line.1314"></a>
+<span class="sourceLineNo">1315</span>                else<a name="line.1315"></a>
+<span class="sourceLineNo">1316</span>                {<a name="line.1316"></a>
+<span class="sourceLineNo">1317</span>                    this.message.setContent(this.emailBody, this.contentType);<a name="line.1317"></a>
+<span class="sourceLineNo">1318</span>                }<a name="line.1318"></a>
+<span class="sourceLineNo">1319</span>            }<a name="line.1319"></a>
+<span class="sourceLineNo">1320</span>            else<a name="line.1320"></a>
+<span class="sourceLineNo">1321</span>            {<a name="line.1321"></a>
+<span class="sourceLineNo">1322</span>                this.message.setText("");<a name="line.1322"></a>
+<span class="sourceLineNo">1323</span>            }<a name="line.1323"></a>
+<span class="sourceLineNo">1324</span><a name="line.1324"></a>
+<span class="sourceLineNo">1325</span>            if (this.fromAddress != null)<a name="line.1325"></a>
+<span class="sourceLineNo">1326</span>            {<a name="line.1326"></a>
+<span class="sourceLineNo">1327</span>                this.message.setFrom(this.fromAddress);<a name="line.1327"></a>
+<span class="sourceLineNo">1328</span>            }<a name="line.1328"></a>
+<span class="sourceLineNo">1329</span>            else<a name="line.1329"></a>
+<span class="sourceLineNo">1330</span>            {<a name="line.1330"></a>
+<span class="sourceLineNo">1331</span>                if (session.getProperty(EmailConstants.MAIL_SMTP_FROM) == null<a name="line.1331"></a>
+<span class="sourceLineNo">1332</span>                        &amp;&amp; session.getProperty(EmailConstants.MAIL_FROM) == null)<a name="line.1332"></a>
+<span class="sourceLineNo">1333</span>                {<a name="line.1333"></a>
+<span class="sourceLineNo">1334</span>                    throw new EmailException("From address required");<a name="line.1334"></a>
+<span class="sourceLineNo">1335</span>                }<a name="line.1335"></a>
+<span class="sourceLineNo">1336</span>            }<a name="line.1336"></a>
+<span class="sourceLineNo">1337</span><a name="line.1337"></a>
+<span class="sourceLineNo">1338</span>            if (this.toList.size() + this.ccList.size() + this.bccList.size() == 0)<a name="line.1338"></a>
+<span class="sourceLineNo">1339</span>            {<a name="line.1339"></a>
+<span class="sourceLineNo">1340</span>                throw new EmailException("At least one receiver address required");<a name="line.1340"></a>
+<span class="sourceLineNo">1341</span>            }<a name="line.1341"></a>
+<span class="sourceLineNo">1342</span><a name="line.1342"></a>
+<span class="sourceLineNo">1343</span>            if (this.toList.size() &gt; 0)<a name="line.1343"></a>
+<span class="sourceLineNo">1344</span>            {<a name="line.1344"></a>
+<span class="sourceLineNo">1345</span>                this.message.setRecipients(<a name="line.1345"></a>
+<span class="sourceLineNo">1346</span>                    Message.RecipientType.TO,<a name="line.1346"></a>
+<span class="sourceLineNo">1347</span>                    this.toInternetAddressArray(this.toList));<a name="line.1347"></a>
+<span class="sourceLineNo">1348</span>            }<a name="line.1348"></a>
+<span class="sourceLineNo">1349</span><a name="line.1349"></a>
+<span class="sourceLineNo">1350</span>            if (this.ccList.size() &gt; 0)<a name="line.1350"></a>
+<span class="sourceLineNo">1351</span>            {<a name="line.1351"></a>
+<span class="sourceLineNo">1352</span>                this.message.setRecipients(<a name="line.1352"></a>
+<span class="sourceLineNo">1353</span>                    Message.RecipientType.CC,<a name="line.1353"></a>
+<span class="sourceLineNo">1354</span>                    this.toInternetAddressArray(this.ccList));<a name="line.1354"></a>
+<span class="sourceLineNo">1355</span>            }<a name="line.1355"></a>
+<span class="sourceLineNo">1356</span><a name="line.1356"></a>
+<span class="sourceLineNo">1357</span>            if (this.bccList.size() &gt; 0)<a name="line.1357"></a>
+<span class="sourceLineNo">1358</span>            {<a name="line.1358"></a>
+<span class="sourceLineNo">1359</span>                this.message.setRecipients(<a name="line.1359"></a>
+<span class="sourceLineNo">1360</span>                    Message.RecipientType.BCC,<a name="line.1360"></a>
+<span class="sourceLineNo">1361</span>                    this.toInternetAddressArray(this.bccList));<a name="line.1361"></a>
+<span class="sourceLineNo">1362</span>            }<a name="line.1362"></a>
+<span class="sourceLineNo">1363</span><a name="line.1363"></a>
+<span class="sourceLineNo">1364</span>            if (this.replyList.size() &gt; 0)<a name="line.1364"></a>
+<span class="sourceLineNo">1365</span>            {<a name="line.1365"></a>
+<span class="sourceLineNo">1366</span>                this.message.setReplyTo(<a name="line.1366"></a>
+<span class="sourceLineNo">1367</span>                    this.toInternetAddressArray(this.replyList));<a name="line.1367"></a>
+<span class="sourceLineNo">1368</span>            }<a name="line.1368"></a>
+<span class="sourceLineNo">1369</span><a name="line.1369"></a>
+<span class="sourceLineNo">1370</span><a name="line.1370"></a>
+<span class="sourceLineNo">1371</span>            if (this.headers.size() &gt; 0)<a name="line.1371"></a>
+<span class="sourceLineNo">1372</span>            {<a name="line.1372"></a>
+<span class="sourceLineNo">1373</span>                for (final Map.Entry&lt;String, String&gt; entry : this.headers.entrySet())<a name="line.1373"></a>
+<span class="sourceLineNo">1374</span>                {<a name="line.1374"></a>
+<span class="sourceLineNo">1375</span>                    final String foldedValue = createFoldedHeaderValue(entry.getKey(), entry.getValue());<a name="line.1375"></a>
+<span class="sourceLineNo">1376</span>                    this.message.addHeader(entry.getKey(), foldedValue);<a name="line.1376"></a>
+<span class="sourceLineNo">1377</span>                }<a name="line.1377"></a>
 <span class="sourceLineNo">1378</span>            }<a name="line.1378"></a>
-<span class="sourceLineNo">1379</span>        }<a name="line.1379"></a>
-<span class="sourceLineNo">1380</span>        catch (final MessagingException me)<a name="line.1380"></a>
-<span class="sourceLineNo">1381</span>        {<a name="line.1381"></a>
-<span class="sourceLineNo">1382</span>            throw new EmailException(me);<a name="line.1382"></a>
-<span class="sourceLineNo">1383</span>        }<a name="line.1383"></a>
-<span class="sourceLineNo">1384</span>    }<a name="line.1384"></a>
-<span class="sourceLineNo">1385</span><a name="line.1385"></a>
-<span class="sourceLineNo">1386</span>    /**<a name="line.1386"></a>
-<span class="sourceLineNo">1387</span>     * Sends the previously created MimeMessage to the SMTP server.<a name="line.1387"></a>
-<span class="sourceLineNo">1388</span>     *<a name="line.1388"></a>
-<span class="sourceLineNo">1389</span>     * @return the message id of the underlying MimeMessage<a name="line.1389"></a>
-<span class="sourceLineNo">1390</span>     * @throws IllegalArgumentException if the MimeMessage has not been created<a name="line.1390"></a>
-<span class="sourceLineNo">1391</span>     * @throws EmailException the sending failed<a name="line.1391"></a>
-<span class="sourceLineNo">1392</span>     */<a name="line.1392"></a>
-<span class="sourceLineNo">1393</span>    public String sendMimeMessage()<a name="line.1393"></a>
-<span class="sourceLineNo">1394</span>       throws EmailException<a name="line.1394"></a>
-<span class="sourceLineNo">1395</span>    {<a name="line.1395"></a>
-<span class="sourceLineNo">1396</span>        EmailUtils.notNull(this.message, "MimeMessage has not been created yet");<a name="line.1396"></a>
-<span class="sourceLineNo">1397</span><a name="line.1397"></a>
-<span class="sourceLineNo">1398</span>        try<a name="line.1398"></a>
-<span class="sourceLineNo">1399</span>        {<a name="line.1399"></a>
-<span class="sourceLineNo">1400</span>            Transport.send(this.message);<a name="line.1400"></a>
-<span class="sourceLineNo">1401</span>            return this.message.getMessageID();<a name="line.1401"></a>
-<span class="sourceLineNo">1402</span>        }<a name="line.1402"></a>
-<span class="sourceLineNo">1403</span>        catch (final Throwable t)<a name="line.1403"></a>
-<span class="sourceLineNo">1404</span>        {<a name="line.1404"></a>
-<span class="sourceLineNo">1405</span>            final String msg = "Sending the email to the following server failed : "<a name="line.1405"></a>
-<span class="sourceLineNo">1406</span>                + this.getHostName()<a name="line.1406"></a>
-<span class="sourceLineNo">1407</span>                + ":"<a name="line.1407"></a>
-<span class="sourceLineNo">1408</span>                + this.getSmtpPort();<a name="line.1408"></a>
-<span class="sourceLineNo">1409</span><a name="line.1409"></a>
-<span class="sourceLineNo">1410</span>            throw new EmailException(msg, t);<a name="line.1410"></a>
-<span class="sourceLineNo">1411</span>        }<a name="line.1411"></a>
-<span class="sourceLineNo">1412</span>    }<a name="line.1412"></a>
-<span class="sourceLineNo">1413</span><a name="line.1413"></a>
-<span class="sourceLineNo">1414</span>    /**<a name="line.1414"></a>
-<span class="sourceLineNo">1415</span>     * Returns the internal MimeMessage. Please not that the<a name="line.1415"></a>
-<span class="sourceLineNo">1416</span>     * MimeMessage is build by the buildMimeMessage() method.<a name="line.1416"></a>
-<span class="sourceLineNo">1417</span>     *<a name="line.1417"></a>
-<span class="sourceLineNo">1418</span>     * @return the MimeMessage<a name="line.1418"></a>
-<span class="sourceLineNo">1419</span>     */<a name="line.1419"></a>
-<span class="sourceLineNo">1420</span>    public MimeMessage getMimeMessage()<a name="line.1420"></a>
-<span class="sourceLineNo">1421</span>    {<a name="line.1421"></a>
-<span class="sourceLineNo">1422</span>        return this.message;<a name="line.1422"></a>
+<span class="sourceLineNo">1379</span><a name="line.1379"></a>
+<span class="sourceLineNo">1380</span>            if (this.message.getSentDate() == null)<a name="line.1380"></a>
+<span class="sourceLineNo">1381</span>            {<a name="line.1381"></a>
+<span class="sourceLineNo">1382</span>                this.message.setSentDate(getSentDate());<a name="line.1382"></a>
+<span class="sourceLineNo">1383</span>            }<a name="line.1383"></a>
+<span class="sourceLineNo">1384</span><a name="line.1384"></a>
+<span class="sourceLineNo">1385</span>            if (this.popBeforeSmtp)<a name="line.1385"></a>
+<span class="sourceLineNo">1386</span>            {<a name="line.1386"></a>
+<span class="sourceLineNo">1387</span>                final Store store = session.getStore("pop3");<a name="line.1387"></a>
+<span class="sourceLineNo">1388</span>                store.connect(this.popHost, this.popUsername, this.popPassword);<a name="line.1388"></a>
+<span class="sourceLineNo">1389</span>            }<a name="line.1389"></a>
+<span class="sourceLineNo">1390</span>        }<a name="line.1390"></a>
+<span class="sourceLineNo">1391</span>        catch (final MessagingException me)<a name="line.1391"></a>
+<span class="sourceLineNo">1392</span>        {<a name="line.1392"></a>
+<span class="sourceLineNo">1393</span>            throw new EmailException(me);<a name="line.1393"></a>
+<span class="sourceLineNo">1394</span>        }<a name="line.1394"></a>
+<span class="sourceLineNo">1395</span>    }<a name="line.1395"></a>
+<span class="sourceLineNo">1396</span><a name="line.1396"></a>
+<span class="sourceLineNo">1397</span>    /**<a name="line.1397"></a>
+<span class="sourceLineNo">1398</span>     * Sends the previously created MimeMessage to the SMTP server.<a name="line.1398"></a>
+<span class="sourceLineNo">1399</span>     *<a name="line.1399"></a>
+<span class="sourceLineNo">1400</span>     * @return the message id of the underlying MimeMessage<a name="line.1400"></a>
+<span class="sourceLineNo">1401</span>     * @throws IllegalArgumentException if the MimeMessage has not been created<a name="line.1401"></a>
+<span class="sourceLineNo">1402</span>     * @throws EmailException the sending failed<a name="line.1402"></a>
+<span class="sourceLineNo">1403</span>     */<a name="line.1403"></a>
+<span class="sourceLineNo">1404</span>    public String sendMimeMessage()<a name="line.1404"></a>
+<span class="sourceLineNo">1405</span>       throws EmailException<a name="line.1405"></a>
+<span class="sourceLineNo">1406</span>    {<a name="line.1406"></a>
+<span class="sourceLineNo">1407</span>        EmailUtils.notNull(this.message, "MimeMessage has not been created yet");<a name="line.1407"></a>
+<span class="sourceLineNo">1408</span><a name="line.1408"></a>
+<span class="sourceLineNo">1409</span>        try<a name="line.1409"></a>
+<span class="sourceLineNo">1410</span>        {<a name="line.1410"></a>
+<span class="sourceLineNo">1411</span>            Transport.send(this.message);<a name="line.1411"></a>
+<span class="sourceLineNo">1412</span>            return this.message.getMessageID();<a name="line.1412"></a>
+<span class="sourceLineNo">1413</span>        }<a name="line.1413"></a>
+<span class="sourceLineNo">1414</span>        catch (final Throwable t)<a name="line.1414"></a>
+<span class="sourceLineNo">1415</span>        {<a name="line.1415"></a>
+<span class="sourceLineNo">1416</span>            final String msg = "Sending the email to the following server failed : "<a name="line.1416"></a>
+<span class="sourceLineNo">1417</span>                + this.getHostName()<a name="line.1417"></a>
+<span class="sourceLineNo">1418</span>                + ":"<a name="line.1418"></a>
+<span class="sourceLineNo">1419</span>                + this.getSmtpPort();<a name="line.1419"></a>
+<span class="sourceLineNo">1420</span><a name="line.1420"></a>
+<span class="sourceLineNo">1421</span>            throw new EmailException(msg, t);<a name="line.1421"></a>
+<span class="sourceLineNo">1422</span>        }<a name="line.1422"></a>
 <span class="sourceLineNo">1423</span>    }<a name="line.1423"></a>
 <span class="sourceLineNo">1424</span><a name="line.1424"></a>
 <span class="sourceLineNo">1425</span>    /**<a name="line.1425"></a>
-<span class="sourceLineNo">1426</span>     * Sends the email. Internally we build a MimeMessage<a name="line.1426"></a>
-<span class="sourceLineNo">1427</span>     * which is afterwards sent to the SMTP server.<a name="line.1427"></a>
+<span class="sourceLineNo">1426</span>     * Returns the internal MimeMessage. Please not that the<a name="line.1426"></a>
+<span class="sourceLineNo">1427</span>     * MimeMessage is build by the buildMimeMessage() method.<a name="line.1427"></a>
 <span class="sourceLineNo">1428</span>     *<a name="line.1428"></a>
-<span class="sourceLineNo">1429</span>     * @return the message id of the underlying MimeMessage<a name="line.1429"></a>
-<span class="sourceLineNo">1430</span>     * @throws IllegalStateException if the MimeMessage was already built, ie {@link #buildMimeMessage()}<a name="line.1430"></a>
-<span class="sourceLineNo">1431</span>     *   was already called<a name="line.1431"></a>
-<span class="sourceLineNo">1432</span>     * @throws EmailException the sending failed<a name="line.1432"></a>
-<span class="sourceLineNo">1433</span>     */<a name="line.1433"></a>
-<span class="sourceLineNo">1434</span>    public String send() throws EmailException<a name="line.1434"></a>
-<span class="sourceLineNo">1435</span>    {<a name="line.1435"></a>
-<span class="sourceLineNo">1436</span>        this.buildMimeMessage();<a name="line.1436"></a>
-<span class="sourceLineNo">1437</span>        return this.sendMimeMessage();<a name="line.1437"></a>
-<span class="sourceLineNo">1438</span>    }<a name="line.1438"></a>
-<span class="sourceLineNo">1439</span><a name="line.1439"></a>
-<span class="sourceLineNo">1440</span>    /**<a name="line.1440"></a>
-<span class="sourceLineNo">1441</span>     * Sets the sent date for the email.  The sent date will default to the<a name="line.1441"></a>
-<span class="sourceLineNo">1442</span>     * current date if not explicitly set.<a name="line.1442"></a>
-<span class="sourceLineNo">1443</span>     *<a name="line.1443"></a>
-<span class="sourceLineNo">1444</span>     * @param date Date to use as the sent date on the email<a name="line.1444"></a>
-<span class="sourceLineNo">1445</span>     * @since 1.0<a name="line.1445"></a>
-<span class="sourceLineNo">1446</span>     */<a name="line.1446"></a>
-<span class="sourceLineNo">1447</span>    public void setSentDate(final Date date)<a name="line.1447"></a>
-<span class="sourceLineNo">1448</span>    {<a name="line.1448"></a>
-<span class="sourceLineNo">1449</span>        if (date != null)<a name="line.1449"></a>
-<span class="sourceLineNo">1450</span>        {<a name="line.1450"></a>
-<span class="sourceLineNo">1451</span>            // create a separate instance to keep findbugs happy<a name="line.1451"></a>
-<span class="sourceLineNo">1452</span>            this.sentDate = new Date(date.getTime());<a name="line.1452"></a>
-<span class="sourceLineNo">1453</span>        }<a name="line.1453"></a>
-<span class="sourceLineNo">1454</span>    }<a name="line.1454"></a>
-<span class="sourceLineNo">1455</span><a name="line.1455"></a>
-<span class="sourceLineNo">1456</span>    /**<a name="line.1456"></a>
-<span class="sourceLineNo">1457</span>     * Gets the sent date for the email.<a name="line.1457"></a>
-<span class="sourceLineNo">1458</span>     *<a name="line.1458"></a>
-<span class="sourceLineNo">1459</span>     * @return date to be used as the sent date for the email<a name="line.1459"></a>
-<span class="sourceLineNo">1460</span>     * @since 1.0<a name="line.1460"></a>
-<span class="sourceLineNo">1461</span>     */<a name="line.1461"></a>
-<span class="sourceLineNo">1462</span>    public Date getSentDate()<a name="line.1462"></a>
-<span class="sourceLineNo">1463</span>    {<a name="line.1463"></a>
-<span class="sourceLineNo">1464</span>        if (this.sentDate == null)<a name="line.1464"></a>
-<span class="sourceLineNo">1465</span>        {<a name="line.1465"></a>
-<span class="sourceLineNo">1466</span>            return new Date();<a name="line.1466"></a>
-<span class="sourceLineNo">1467</span>        }<a name="line.1467"></a>
-<span class="sourceLineNo">1468</span>        return new Date(this.sentDate.getTime());<a name="line.1468"></a>
-<span class="sourceLineNo">1469</span>    }<a name="line.1469"></a>
-<span class="sourceLineNo">1470</span><a name="line.1470"></a>
-<span class="sourceLineNo">1471</span>    /**<a name="line.1471"></a>
-<span class="sourceLineNo">1472</span>     * Gets the subject of the email.<a name="line.1472"></a>
-<span class="sourceLineNo">1473</span>     *<a name="line.1473"></a>
-<span class="sourceLineNo">1474</span>     * @return email subject<a name="line.1474"></a>
-<span class="sourceLineNo">1475</span>     */<a name="line.1475"></a>
-<span class="sourceLineNo">1476</span>    public String getSubject()<a name="line.1476"></a>
-<span class="sourceLineNo">1477</span>    {<a name="line.1477"></a>
-<span class="sourceLineNo">1478</span>        return this.subject;<a name="line.1478"></a>
-<span class="sourceLineNo">1479</span>    }<a name="line.1479"></a>
-<span class="sourceLineNo">1480</span><a name="line.1480"></a>
-<span class="sourceLineNo">1481</span>    /**<a name="line.1481"></a>
-<span class="sourceLineNo">1482</span>     * Gets the sender of the email.<a name="line.1482"></a>
-<span class="sourceLineNo">1483</span>     *<a name="line.1483"></a>
-<span class="sourceLineNo">1484</span>     * @return from address<a name="line.1484"></a>
-<span class="sourceLineNo">1485</span>     */<a name="line.1485"></a>
-<span class="sourceLineNo">1486</span>    public InternetAddress getFromAddress()<a name="line.1486"></a>
-<span class="sourceLineNo">1487</span>    {<a name="line.1487"></a>
-<span class="sourceLineNo">1488</span>        return this.fromAddress;<a name="line.1488"></a>
-<span class="sourceLineNo">1489</span>    }<a name="line.1489"></a>
-<span class="sourceLineNo">1490</span><a name="line.1490"></a>
-<span class="sourceLineNo">1491</span>    /**<a name="line.1491"></a>
-<span class="sourceLineNo">1492</span>     * Gets the host name of the SMTP server,<a name="line.1492"></a>
-<span class="sourceLineNo">1493</span>     *<a name="line.1493"></a>
-<span class="sourceLineNo">1494</span>     * @return host name<a name="line.1494"></a>
-<span class="sourceLineNo">1495</span>     */<a name="line.1495"></a>
-<span class="sourceLineNo">1496</span>    public String getHostName()<a name="line.1496"></a>
-<span class="sourceLineNo">1497</span>    {<a name="line.1497"></a>
-<span class="sourceLineNo">1498</span>        if (this.session != null)<a name="line.1498"></a>
-<span class="sourceLineNo">1499</span>        {<a name="line.1499"></a>
-<span class="sourceLineNo">1500</span>            return this.session.getProperty(MAIL_HOST);<a name="line.1500"></a>
-<span class="sourceLineNo">1501</span>        }<a name="line.1501"></a>
-<span class="sourceLineNo">1502</span>        else if (EmailUtils.isNotEmpty(this.hostName))<a name="line.1502"></a>
-<span class="sourceLineNo">1503</span>        {<a name="line.1503"></a>
-<span class="sourceLineNo">1504</span>            return this.hostName;<a name="line.1504"></a>
-<span class="sourceLineNo">1505</span>        }<a name="line.1505"></a>
-<span class="sourceLineNo">1506</span>        return null;<a name="line.1506"></a>
-<span class="sourceLineNo">1507</span>    }<a name="line.1507"></a>
-<span class="sourceLineNo">1508</span><a name="line.1508"></a>
-<span class="sourceLineNo">1509</span>    /**<a name="line.1509"></a>
-<span class="sourceLineNo">1510</span>     * Gets the listening port of the SMTP server.<a name="line.1510"></a>
-<span class="sourceLineNo">1511</span>     *<a name="line.1511"></a>
-<span class="sourceLineNo">1512</span>     * @return smtp port<a name="line.1512"></a>
-<span class="sourceLineNo">1513</span>     */<a name="line.1513"></a>
-<span class="sourceLineNo">1514</span>    public String getSmtpPort()<a name="line.1514"></a>
-<span class="sourceLineNo">1515</span>    {<a name="line.1515"></a>
-<span class="sourceLineNo">1516</span>        if (this.session != null)<a name="line.1516"></a>
-<span class="sourceLineNo">1517</span>        {<a name="line.1517"></a>
-<span class="sourceLineNo">1518</span>            return this.session.getProperty(MAIL_PORT);<a name="line.1518"></a>
-<span class="sourceLineNo">1519</span>        }<a name="line.1519"></a>
-<span class="sourceLineNo">1520</span>        else if (EmailUtils.isNotEmpty(this.smtpPort))<a name="line.1520"></a>
-<span class="sourceLineNo">1521</span>        {<a name="line.1521"></a>
-<span class="sourceLineNo">1522</span>            return this.smtpPort;<a name="line.1522"></a>
-<span class="sourceLineNo">1523</span>        }<a name="line.1523"></a>
-<span class="sourceLineNo">1524</span>        return null;<a name="line.1524"></a>
-<span class="sourceLineNo">1525</span>    }<a name="line.1525"></a>
-<span class="sourceLineNo">1526</span><a name="line.1526"></a>
-<span class="sourceLineNo">1527</span>    /**<a name="line.1527"></a>
-<span class="sourceLineNo">1528</span>     * Gets whether the client is configured to require STARTTLS.<a name="line.1528"></a>
-<span class="sourceLineNo">1529</span>     *<a name="line.1529"></a>
-<span class="sourceLineNo">1530</span>     * @return true if using STARTTLS for authentication, false otherwise<a name="line.1530"></a>
-<span class="sourceLineNo">1531</span>     * @since 1.3<a name="line.1531"></a>
-<span class="sourceLineNo">1532</span>     */<a name="line.1532"></a>
-<span class="sourceLineNo">1533</span>    public boolean isStartTLSRequired()<a name="line.1533"></a>
-<span class="sourceLineNo">1534</span>    {<a name="line.1534"></a>
-<span class="sourceLineNo">1535</span>        return this.startTlsRequired;<a name="line.1535"></a>
+<span class="sourceLineNo">1429</span>     * @return the MimeMessage<a name="line.1429"></a>
+<span class="sourceLineNo">1430</span>     */<a name="line.1430"></a>
+<span class="sourceLineNo">1431</span>    public MimeMessage getMimeMessage()<a name="line.1431"></a>
+<span class="sourceLineNo">1432</span>    {<a name="line.1432"></a>
+<span class="sourceLineNo">1433</span>        return this.message;<a name="line.1433"></a>
+<span class="sourceLineNo">1434</span>    }<a name="line.1434"></a>
+<span class="sourceLineNo">1435</span><a name="line.1435"></a>
+<span class="sourceLineNo">1436</span>    /**<a name="line.1436"></a>
+<span class="sourceLineNo">1437</span>     * Sends the email. Internally we build a MimeMessage<a name="line.1437"></a>
+<span class="sourceLineNo">1438</span>     * which is afterwards sent to the SMTP server.<a name="line.1438"></a>
+<span class="sourceLineNo">1439</span>     *<a name="line.1439"></a>
+<span class="sourceLineNo">1440</span>     * @return the message id of the underlying MimeMessage<a name="line.1440"></a>
+<span class="sourceLineNo">1441</span>     * @throws IllegalStateException if the MimeMessage was already built, ie {@link #buildMimeMessage()}<a name="line.1441"></a>
+<span class="sourceLineNo">1442</span>     *   was already called<a name="line.1442"></a>
+<span class="sourceLineNo">1443</span>     * @throws EmailException the sending failed<a name="line.1443"></a>
+<span class="sourceLineNo">1444</span>     */<a name="line.1444"></a>
+<span class="sourceLineNo">1445</span>    public String send() throws EmailException<a name="line.1445"></a>
+<span class="sourceLineNo">1446</span>    {<a name="line.1446"></a>
+<span class="sourceLineNo">1447</span>        this.buildMimeMessage();<a name="line.1447"></a>
+<span class="sourceLineNo">1448</span>        return this.sendMimeMessage();<a name="line.1448"></a>
+<span class="sourceLineNo">1449</span>    }<a name="line.1449"></a>
+<span class="sourceLineNo">1450</span><a name="line.1450"></a>
+<span class="sourceLineNo">1451</span>    /**<a name="line.1451"></a>
+<span class="sourceLineNo">1452</span>     * Sets the sent date for the email.  The sent date will default to the<a name="line.1452"></a>
+<span class="sourceLineNo">1453</span>     * current date if not explicitly set.<a name="line.1453"></a>
+<span class="sourceLineNo">1454</span>     *<a name="line.1454"></a>
+<span class="sourceLineNo">1455</span>     * @param date Date to use as the sent date on the email<a name="line.1455"></a>
+<span class="sourceLineNo">1456</span>     * @since 1.0<a name="line.1456"></a>
+<span class="sourceLineNo">1457</span>     */<a name="line.1457"></a>
+<span class="sourceLineNo">1458</span>    public void setSentDate(final Date date)<a name="line.1458"></a>
+<span class="sourceLineNo">1459</span>    {<a name="line.1459"></a>
+<span class="sourceLineNo">1460</span>        if (date != null)<a name="line.1460"></a>
+<span class="sourceLineNo">1461</span>        {<a name="line.1461"></a>
+<span class="sourceLineNo">1462</span>            // create a separate instance to keep findbugs happy<a name="line.1462"></a>
+<span class="sourceLineNo">1463</span>            this.sentDate = new Date(date.getTime());<a name="line.1463"></a>
+<span class="sourceLineNo">1464</span>        }<a name="line.1464"></a>
+<span class="sourceLineNo">1465</span>    }<a name="line.1465"></a>
+<span class="sourceLineNo">1466</span><a name="line.1466"></a>
+<span class="sourceLineNo">1467</span>    /**<a name="line.1467"></a>
+<span class="sourceLineNo">1468</span>     * Gets the sent date for the email.<a name="line.1468"></a>
+<span class="sourceLineNo">1469</span>     *<a name="line.1469"></a>
+<span class="sourceLineNo">1470</span>     * @return date to be used as the sent date for the email<a name="line.1470"></a>
+<span class="sourceLineNo">1471</span>     * @since 1.0<a name="line.1471"></a>
+<span class="sourceLineNo">1472</span>     */<a name="line.1472"></a>
+<span class="sourceLineNo">1473</span>    public Date getSentDate()<a name="line.1473"></a>
+<span class="sourceLineNo">1474</span>    {<a name="line.1474"></a>
+<span class="sourceLineNo">1475</span>        if (this.sentDate == null)<a name="line.1475"></a>
+<span class="sourceLineNo">1476</span>        {<a name="line.1476"></a>
+<span class="sourceLineNo">1477</span>            return new Date();<a name="line.1477"></a>
+<span class="sourceLineNo">1478</span>        }<a name="line.1478"></a>
+<span class="sourceLineNo">1479</span>        return new Date(this.sentDate.getTime());<a name="line.1479"></a>
+<span class="sourceLineNo">1480</span>    }<a name="line.1480"></a>
+<span class="sourceLineNo">1481</span><a name="line.1481"></a>
+<span class="sourceLineNo">1482</span>    /**<a name="line.1482"></a>
+<span class="sourceLineNo">1483</span>     * Gets the subject of the email.<a name="line.1483"></a>
+<span class="sourceLineNo">1484</span>     *<a name="line.1484"></a>
+<span class="sourceLineNo">1485</span>     * @return email subject<a name="line.1485"></a>
+<span class="sourceLineNo">1486</span>     */<a name="line.1486"></a>
+<span class="sourceLineNo">1487</span>    public String getSubject()<a name="line.1487"></a>
+<span class="sourceLineNo">1488</span>    {<a name="line.1488"></a>
+<span class="sourceLineNo">1489</span>        return this.subject;<a name="line.1489"></a>
+<span class="sourceLineNo">1490</span>    }<a name="line.1490"></a>
+<span class="sourceLineNo">1491</span><a name="line.1491"></a>
+<span class="sourceLineNo">1492</span>    /**<a name="line.1492"></a>
+<span class="sourceLineNo">1493</span>     * Gets the sender of the email.<a name="line.1493"></a>
+<span class="sourceLineNo">1494</span>     *<a name="line.1494"></a>
+<span class="sourceLineNo">1495</span>     * @return from address<a name="line.1495"></a>
+<span class="sourceLineNo">1496</span>     */<a name="line.1496"></a>
+<span class="sourceLineNo">1497</span>    public InternetAddress getFromAddress()<a name="line.1497"></a>
+<span class="sourceLineNo">1498</span>    {<a name="line.1498"></a>
+<span class="sourceLineNo">1499</span>        return this.fromAddress;<a name="line.1499"></a>
+<span class="sourceLineNo">1500</span>    }<a name="line.1500"></a>
+<span class="sourceLineNo">1501</span><a name="line.1501"></a>
+<span class="sourceLineNo">1502</span>    /**<a name="line.1502"></a>
+<span class="sourceLineNo">1503</span>     * Gets the host name of the SMTP server,<a name="line.1503"></a>
+<span class="sourceLineNo">1504</span>     *<a name="line.1504"></a>
+<span class="sourceLineNo">1505</span>     * @return host name<a name="line.1505"></a>
+<span class="sourceLineNo">1506</span>     */<a name="line.1506"></a>
+<span class="sourceLineNo">1507</span>    public String getHostName()<a name="line.1507"></a>
+<span class="sourceLineNo">1508</span>    {<a name="line.1508"></a>
+<span class="sourceLineNo">1509</span>        if (this.session != null)<a name="line.1509"></a>
+<span class="sourceLineNo">1510</span>        {<a name="line.1510"></a>
+<span class="sourceLineNo">1511</span>            return this.session.getProperty(MAIL_HOST);<a name="line.1511"></a>
+<span class="sourceLineNo">1512</span>        }<a name="line.1512"></a>
+<span class="sourceLineNo">1513</span>        else if (EmailUtils.isNotEmpty(this.hostName))<a name="line.1513"></a>
+<span class="sourceLineNo">1514</span>        {<a name="line.1514"></a>
+<span class="sourceLineNo">1515</span>            return this.hostName;<a name="line.1515"></a>
+<span class="sourceLineNo">1516</span>        }<a name="line.1516"></a>
+<span class="sourceLineNo">1517</span>        return null;<a name="line.1517"></a>
+<span class="sourceLineNo">1518</span>    }<a name="line.1518"></a>
+<span class="sourceLineNo">1519</span><a name="line.1519"></a>
+<span class="sourceLineNo">1520</span>    /**<a name="line.1520"></a>
+<span class="sourceLineNo">1521</span>     * Gets the listening port of the SMTP server.<a name="line.1521"></a>
+<span class="sourceLineNo">1522</span>     *<a name="line.1522"></a>
+<span class="sourceLineNo">1523</span>     * @return smtp port<a name="line.1523"></a>
+<span class="sourceLineNo">1524</span>     */<a name="line.1524"></a>
+<span class="sourceLineNo">1525</span>    public String getSmtpPort()<a name="line.1525"></a>
+<span class="sourceLineNo">1526</span>    {<a name="line.1526"></a>
+<span class="sourceLineNo">1527</span>        if (this.session != null)<a name="line.1527"></a>
+<span class="sourceLineNo">1528</span>        {<a name="line.1528"></a>
+<span class="sourceLineNo">1529</span>            return this.session.getProperty(MAIL_PORT);<a name="line.1529"></a>
+<span class="sourceLineNo">1530</span>        }<a name="line.1530"></a>
+<span class="sourceLineNo">1531</span>        else if (EmailUtils.isNotEmpty(this.smtpPort))<a name="line.1531"></a>
+<span class="sourceLineNo">1532</span>        {<a name="line.1532"></a>
+<span class="sourceLineNo">1533</span>            return this.smtpPort;<a name="line.1533"></a>
+<span class="sourceLineNo">1534</span>        }<a name="line.1534"></a>
+<span class="sourceLineNo">1535</span>        return null;<a name="line.1535"></a>
 <span class="sourceLineNo">1536</span>    }<a name="line.1536"></a>
 <span class="sourceLineNo">1537</span><a name="line.1537"></a>
 <span class="sourceLineNo">1538</span>    /**<a name="line.1538"></a>
-<span class="sourceLineNo">1539</span>     * Gets whether the client is configured to try to enable STARTTLS.<a name="line.1539"></a>
+<span class="sourceLineNo">1539</span>     * Gets whether the client is configured to require STARTTLS.<a name="line.1539"></a>
 <span class="sourceLineNo">1540</span>     *<a name="line.1540"></a>
 <span class="sourceLineNo">1541</span>     * @return true if using STARTTLS for authentication, false otherwise<a name="line.1541"></a>
 <span class="sourceLineNo">1542</span>     * @since 1.3<a name="line.1542"></a>
 <span class="sourceLineNo">1543</span>     */<a name="line.1543"></a>
-<span class="sourceLineNo">1544</span>    public boolean isStartTLSEnabled()<a name="line.1544"></a>
+<span class="sourceLineNo">1544</span>    public boolean isStartTLSRequired()<a name="line.1544"></a>
 <span class="sourceLineNo">1545</span>    {<a name="line.1545"></a>
-<span class="sourceLineNo">1546</span>        return this.startTlsEnabled || tls;<a name="line.1546"></a>
+<span class="sourceLineNo">1546</span>        return this.startTlsRequired;<a name="line.1546"></a>
 <span class="sourceLineNo">1547</span>    }<a name="line.1547"></a>
 <span class="sourceLineNo">1548</span><a name="line.1548"></a>
 <span class="sourceLineNo">1549</span>    /**<a name="line.1549"></a>
 <span class="sourceLineNo">1550</span>     * Gets whether the client is configured to try to enable STARTTLS.<a name="line.1550"></a>
-<span class="sourceLineNo">1551</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1551"></a>
-<span class="sourceLineNo">1552</span>     *<a name="line.1552"></a>
-<span class="sourceLineNo">1553</span>     * @deprecated since 1.3, use isStartTLSEnabled() instead<a name="line.1553"></a>
-<span class="sourceLineNo">1554</span>     * @return true if using STARTTLS for authentication, false otherwise<a name="line.1554"></a>
-<span class="sourceLineNo">1555</span>     * @since 1.1<a name="line.1555"></a>
-<span class="sourceLineNo">1556</span>     */<a name="line.1556"></a>
-<span class="sourceLineNo">1557</span>    @Deprecated<a name="line.1557"></a>
-<span class="sourceLineNo">1558</span>    public boolean isTLS()<a name="line.1558"></a>
-<span class="sourceLineNo">1559</span>    {<a name="line.1559"></a>
-<span class="sourceLineNo">1560</span>        return isStartTLSEnabled();<a name="line.1560"></a>
-<span class="sourceLineNo">1561</span>    }<a name="line.1561"></a>
-<span class="sourceLineNo">1562</span><a name="line.1562"></a>
-<span class="sourceLineNo">1563</span>    /**<a name="line.1563"></a>
-<span class="sourceLineNo">1564</span>     * Utility to copy List of known InternetAddress objects into an<a name="line.1564"></a>
-<span class="sourceLineNo">1565</span>     * array.<a name="line.1565"></a>
-<span class="sourceLineNo">1566</span>     *<a name="line.1566"></a>
-<span class="sourceLineNo">1567</span>     * @param list A List.<a name="line.1567"></a>
-<span class="sourceLineNo">1568</span>     * @return An InternetAddress[].<a name="line.1568"></a>
-<span class="sourceLineNo">1569</span>     * @since 1.0<a name="line.1569"></a>
-<span class="sourceLineNo">1570</span>     */<a name="line.1570"></a>
-<span class="sourceLineNo">1571</span>    protected InternetAddress[] toInternetAddressArray(final List&lt;InternetAddress&gt; list)<a name="line.1571"></a>
-<span class="sourceLineNo">1572</span>    {<a name="line.1572"></a>
-<span class="sourceLineNo">1573</span>        return list.toArray(new InternetAddress[list.size()]);<a name="line.1573"></a>
-<span class="sourceLineNo">1574</span>    }<a name="line.1574"></a>
-<span class="sourceLineNo">1575</span><a name="line.1575"></a>
-<span class="sourceLineNo">1576</span>    /**<a name="line.1576"></a>
-<span class="sourceLineNo">1577</span>     * Set details regarding "pop3 before smtp" authentication.<a name="line.1577"></a>
-<span class="sourceLineNo">1578</span>     *<a name="line.1578"></a>
-<span class="sourceLineNo">1579</span>     * @param newPopBeforeSmtp Whether or not to log into pop3 server before sending mail.<a name="line.1579"></a>
-<span class="sourceLineNo">1580</span>     * @param newPopHost The pop3 host to use.<a name="line.1580"></a>
-<span class="sourceLineNo">1581</span>     * @param newPopUsername The pop3 username.<a name="line.1581"></a>
-<span class="sourceLineNo">1582</span>     * @param newPopPassword The pop3 password.<a name="line.1582"></a>
-<span class="sourceLineNo">1583</span>     * @since 1.0<a name="line.1583"></a>
-<span class="sourceLineNo">1584</span>     */<a name="line.1584"></a>
-<span class="sourceLineNo">1585</span>    public void setPopBeforeSmtp(<a name="line.1585"></a>
-<span class="sourceLineNo">1586</span>        final boolean newPopBeforeSmtp,<a name="line.1586"></a>
-<span class="sourceLineNo">1587</span>        final String newPopHost,<a name="line.1587"></a>
-<span class="sourceLineNo">1588</span>        final String newPopUsername,<a name="line.1588"></a>
-<span class="sourceLineNo">1589</span>        final String newPopPassword)<a name="line.1589"></a>
-<span class="sourceLineNo">1590</span>    {<a name="line.1590"></a>
-<span class="sourceLineNo">1591</span>        this.popBeforeSmtp = newPopBeforeSmtp;<a name="line.1591"></a>
-<span class="sourceLineNo">1592</span>        this.popHost = newPopHost;<a name="line.1592"></a>
-<span class="sourceLineNo">1593</span>        this.popUsername = newPopUsername;<a name="line.1593"></a>
-<span class="sourceLineNo">1594</span>        this.popPassword = newPopPassword;<a name="line.1594"></a>
-<span class="sourceLineNo">1595</span>    }<a name="line.1595"></a>
-<span class="sourceLineNo">1596</span><a name="line.1596"></a>
-<span class="sourceLineNo">1597</span>    /**<a name="line.1597"></a>
-<span class="sourceLineNo">1598</span>     * Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS).<a name="line.1598"></a>
-<span class="sourceLineNo">1599</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1599"></a>
-<span class="sourceLineNo">1600</span>     *<a name="line.1600"></a>
-<span class="sourceLineNo">1601</span>     * @deprecated since 1.3, use isSSLOnConnect() instead<a name="line.1601"></a>
-<span class="sourceLineNo">1602</span>     * @return true if SSL enabled for the transport<a name="line.1602"></a>
-<span class="sourceLineNo">1603</span>     */<a name="line.1603"></a>
-<span class="sourceLineNo">1604</span>    @Deprecated<a name="line.1604"></a>
-<span class="sourceLineNo">1605</span>    public boolean isSSL()<a name="line.1605"></a>
-<span class="sourceLineNo">1606</span>    {<a name="line.1606"></a>
-<span class="sourceLineNo">1607</span>        return isSSLOnConnect();<a name="line.1607"></a>
-<span class="sourceLineNo">1608</span>    }<a name="line.1608"></a>
-<span class="sourceLineNo">1609</span><a name="line.1609"></a>
-<span class="sourceLineNo">1610</span>    /**<a name="line.1610"></a>
-<span class="sourceLineNo">1611</span>     * Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS).<a name="line.1611"></a>
-<span class="sourceLineNo">1612</span>     *<a name="line.1612"></a>
+<span class="sourceLineNo">1551</span>     *<a name="line.1551"></a>
+<span class="sourceLineNo">1552</span>     * @return true if using STARTTLS for authentication, false otherwise<a name="line.1552"></a>
+<span class="sourceLineNo">1553</span>     * @since 1.3<a name="line.1553"></a>
+<span class="sourceLineNo">1554</span>     */<a name="line.1554"></a>
+<span class="sourceLineNo">1555</span>    public boolean isStartTLSEnabled()<a name="line.1555"></a>
+<span class="sourceLineNo">1556</span>    {<a name="line.1556"></a>
+<span class="sourceLineNo">1557</span>        return this.startTlsEnabled || tls;<a name="line.1557"></a>
+<span class="sourceLineNo">1558</span>    }<a name="line.1558"></a>
+<span class="sourceLineNo">1559</span><a name="line.1559"></a>
+<span class="sourceLineNo">1560</span>    /**<a name="line.1560"></a>
+<span class="sourceLineNo">1561</span>     * Gets whether the client is configured to try to enable STARTTLS.<a name="line.1561"></a>
+<span class="sourceLineNo">1562</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1562"></a>
+<span class="sourceLineNo">1563</span>     *<a name="line.1563"></a>
+<span class="sourceLineNo">1564</span>     * @deprecated since 1.3, use isStartTLSEnabled() instead<a name="line.1564"></a>
+<span class="sourceLineNo">1565</span>     * @return true if using STARTTLS for authentication, false otherwise<a name="line.1565"></a>
+<span class="sourceLineNo">1566</span>     * @since 1.1<a name="line.1566"></a>
+<span class="sourceLineNo">1567</span>     */<a name="line.1567"></a>
+<span class="sourceLineNo">1568</span>    @Deprecated<a name="line.1568"></a>
+<span class="sourceLineNo">1569</span>    public boolean isTLS()<a name="line.1569"></a>
+<span class="sourceLineNo">1570</span>    {<a name="line.1570"></a>
+<span class="sourceLineNo">1571</span>        return isStartTLSEnabled();<a name="line.1571"></a>
+<span class="sourceLineNo">1572</span>    }<a name="line.1572"></a>
+<span class="sourceLineNo">1573</span><a name="line.1573"></a>
+<span class="sourceLineNo">1574</span>    /**<a name="line.1574"></a>
+<span class="sourceLineNo">1575</span>     * Utility to copy List of known InternetAddress objects into an<a name="line.1575"></a>
+<span class="sourceLineNo">1576</span>     * array.<a name="line.1576"></a>
+<span class="sourceLineNo">1577</span>     *<a name="line.1577"></a>
+<span class="sourceLineNo">1578</span>     * @param list A List.<a name="line.1578"></a>
+<span class="sourceLineNo">1579</span>     * @return An InternetAddress[].<a name="line.1579"></a>
+<span class="sourceLineNo">1580</span>     * @since 1.0<a name="line.1580"></a>
+<span class="sourceLineNo">1581</span>     */<a name="line.1581"></a>
+<span class="sourceLineNo">1582</span>    protected InternetAddress[] toInternetAddressArray(final List&lt;InternetAddress&gt; list)<a name="line.1582"></a>
+<span class="sourceLineNo">1583</span>    {<a name="line.1583"></a>
+<span class="sourceLineNo">1584</span>        return list.toArray(new InternetAddress[list.size()]);<a name="line.1584"></a>
+<span class="sourceLineNo">1585</span>    }<a name="line.1585"></a>
+<span class="sourceLineNo">1586</span><a name="line.1586"></a>
+<span class="sourceLineNo">1587</span>    /**<a name="line.1587"></a>
+<span class="sourceLineNo">1588</span>     * Set details regarding "pop3 before smtp" authentication.<a name="line.1588"></a>
+<span class="sourceLineNo">1589</span>     *<a name="line.1589"></a>
+<span class="sourceLineNo">1590</span>     * @param newPopBeforeSmtp Whether or not to log into pop3 server before sending mail.<a name="line.1590"></a>
+<span class="sourceLineNo">1591</span>     * @param newPopHost The pop3 host to use.<a name="line.1591"></a>
+<span class="sourceLineNo">1592</span>     * @param newPopUsername The pop3 username.<a name="line.1592"></a>
+<span class="sourceLineNo">1593</span>     * @param newPopPassword The pop3 password.<a name="line.1593"></a>
+<span class="sourceLineNo">1594</span>     * @since 1.0<a name="line.1594"></a>
+<span class="sourceLineNo">1595</span>     */<a name="line.1595"></a>
+<span class="sourceLineNo">1596</span>    public void setPopBeforeSmtp(<a name="line.1596"></a>
+<span class="sourceLineNo">1597</span>        final boolean newPopBeforeSmtp,<a name="line.1597"></a>
+<span class="sourceLineNo">1598</span>        final String newPopHost,<a name="line.1598"></a>
+<span class="sourceLineNo">1599</span>        final String newPopUsername,<a name="line.1599"></a>
+<span class="sourceLineNo">1600</span>        final String newPopPassword)<a name="line.1600"></a>
+<span class="sourceLineNo">1601</span>    {<a name="line.1601"></a>
+<span class="sourceLineNo">1602</span>        this.popBeforeSmtp = newPopBeforeSmtp;<a name="line.1602"></a>
+<span class="sourceLineNo">1603</span>        this.popHost = newPopHost;<a name="line.1603"></a>
+<span class="sourceLineNo">1604</span>        this.popUsername = newPopUsername;<a name="line.1604"></a>
+<span class="sourceLineNo">1605</span>        this.popPassword = newPopPassword;<a name="line.1605"></a>
+<span class="sourceLineNo">1606</span>    }<a name="line.1606"></a>
+<span class="sourceLineNo">1607</span><a name="line.1607"></a>
+<span class="sourceLineNo">1608</span>    /**<a name="line.1608"></a>
+<span class="sourceLineNo">1609</span>     * Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS).<a name="line.1609"></a>
+<span class="sourceLineNo">1610</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1610"></a>
+<span class="sourceLineNo">1611</span>     *<a name="line.1611"></a>
+<span class="sourceLineNo">1612</span>     * @deprecated since 1.3, use isSSLOnConnect() instead<a name="line.1612"></a>
 <span class="sourceLineNo">1613</span>     * @return true if SSL enabled for the transport<a name="line.1613"></a>
-<span class="sourceLineNo">1614</span>     * @since 1.3<a name="line.1614"></a>
-<span class="sourceLineNo">1615</span>     */<a name="line.1615"></a>
-<span class="sourceLineNo">1616</span>    public boolean isSSLOnConnect()<a name="line.1616"></a>
+<span class="sourceLineNo">1614</span>     */<a name="line.1614"></a>
+<span class="sourceLineNo">1615</span>    @Deprecated<a name="line.1615"></a>
+<span class="sourceLineNo">1616</span>    public boolean isSSL()<a name="line.1616"></a>
 <span class="sourceLineNo">1617</span>    {<a name="line.1617"></a>
-<span class="sourceLineNo">1618</span>        return sslOnConnect || ssl;<a name="line.1618"></a>
+<span class="sourceLineNo">1618</span>        return isSSLOnConnect();<a name="line.1618"></a>
 <span class="sourceLineNo">1619</span>    }<a name="line.1619"></a>
 <span class="sourceLineNo">1620</span><a name="line.1620"></a>
 <span class="sourceLineNo">1621</span>    /**<a name="line.1621"></a>
-<span class="sourceLineNo">1622</span>     * Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS).<a name="line.1622"></a>
-<span class="sourceLineNo">1623</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1623"></a>
-<span class="sourceLineNo">1624</span>     *<a name="line.1624"></a>
-<span class="sourceLineNo">1625</span>     * @deprecated since 1.3, use setSSLOnConnect() instead<a name="line.1625"></a>
-<span class="sourceLineNo">1626</span>     * @param ssl whether to enable the SSL transport<a name="line.1626"></a>
-<span class="sourceLineNo">1627</span>     */<a name="line.1627"></a>
-<span class="sourceLineNo">1628</span>    @Deprecated<a name="line.1628"></a>
-<span class="sourceLineNo">1629</span>    public void setSSL(final boolean ssl)<a name="line.1629"></a>
-<span class="sourceLineNo">1630</span>    {<a name="line.1630"></a>
-<span class="sourceLineNo">1631</span>        setSSLOnConnect(ssl);<a name="line.1631"></a>
-<span class="sourceLineNo">1632</span>    }<a name="line.1632"></a>
-<span class="sourceLineNo">1633</span><a name="line.1633"></a>
-<span class="sourceLineNo">1634</span>    /**<a name="line.1634"></a>
-<span class="sourceLineNo">1635</span>     * Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS).<a name="line.1635"></a>
-<span class="sourceLineNo">1636</span>     *<a name="line.1636"></a>
+<span class="sourceLineNo">1622</span>     * Returns whether SSL/TLS encryption for the transport is currently enabled (SMTPS/POPS).<a name="line.1622"></a>
+<span class="sourceLineNo">1623</span>     *<a name="line.1623"></a>
+<span class="sourceLineNo">1624</span>     * @return true if SSL enabled for the transport<a name="line.1624"></a>
+<span class="sourceLineNo">1625</span>     * @since 1.3<a name="line.1625"></a>
+<span class="sourceLineNo">1626</span>     */<a name="line.1626"></a>
+<span class="sourceLineNo">1627</span>    public boolean isSSLOnConnect()<a name="line.1627"></a>
+<span class="sourceLineNo">1628</span>    {<a name="line.1628"></a>
+<span class="sourceLineNo">1629</span>        return sslOnConnect || ssl;<a name="line.1629"></a>
+<span class="sourceLineNo">1630</span>    }<a name="line.1630"></a>
+<span class="sourceLineNo">1631</span><a name="line.1631"></a>
+<span class="sourceLineNo">1632</span>    /**<a name="line.1632"></a>
+<span class="sourceLineNo">1633</span>     * Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS).<a name="line.1633"></a>
+<span class="sourceLineNo">1634</span>     * See EMAIL-105 for reason of deprecation.<a name="line.1634"></a>
+<span class="sourceLineNo">1635</span>     *<a name="line.1635"></a>
+<span class="sourceLineNo">1636</span>     * @deprecated since 1.3, use setSSLOnConnect() instead<a name="line.1636"></a>
 <span class="sourceLineNo">1637</span>     * @param ssl whether to enable the SSL transport<a name="line.1637"></a>
-<span class="sourceLineNo">1638</span>     * @return An Email.<a name="line.1638"></a>
-<span class="sourceLineNo">1639</span>     * @since 1.3<a name="line.1639"></a>
-<span class="sourceLineNo">1640</span>     */<a name="line.1640"></a>
-<span class="sourceLineNo">1641</span>    public Email setSSLOnConnect(final boolean ssl)<a name="line.1641"></a>
-<span class="sourceLineNo">1642</span>    {<a name="line.1642"></a>
-<span class="sourceLineNo">1643</span>        checkSessionAlreadyInitialized();<a name="line.1643"></a>
-<span class="sourceLineNo">1644</span>        this.sslOnConnect = ssl;<a name="line.1644"></a>
-<span class="sourceLineNo">1645</span>        this.ssl = ssl;<a name="line.1645"></a>
-<span class="sourceLineNo">1646</span>        return this;<a name="line.1646"></a>
-<span class="sourceLineNo">1647</span>    }<a name="line.1647"></a>
-<span class="sourceLineNo">1648</span><a name="line.1648"></a>
-<span class="sourceLineNo">1649</span>    /**<a name="line.1649"></a>
-<span class="sourceLineNo">1650</span>    * Is the server identity checked as specified by RFC 2595<a name="line.1650"></a>
-<span class="sourceLineNo">1651</span>    *<a name="line.1651"></a>
-<span class="sourceLineNo">1652</span>    * @return true if the server identity is checked<a name="line.1652"></a>
-<span class="sourceLineNo">1653</span>    * @since 1.3<a name="line.1653"></a>
-<span class="sourceLineNo">1654</span>    */<a name="line.1654"></a>
-<span class="sourceLineNo">1655</span>    public boolean isSSLCheckServerIdentity()<a name="line.1655"></a>
-<span class="sourceLineNo">1656</span>    {<a name="line.1656"></a>
-<span class="sourceLineNo">1657</span>        return sslCheckServerIdentity;<a name="line.1657"></a>
+<span class="sourceLineNo">1638</span>     */<a name="line.1638"></a>
+<span class="sourceLineNo">1639</span>    @Deprecated<a name="line.1639"></a>
+<span class="sourceLineNo">1640</span>    public void setSSL(final boolean ssl)<a name="line.1640"></a>
+<span class="sourceLineNo">1641</span>    {<a name="line.1641"></a>
+<span class="sourceLineNo">1642</span>        setSSLOnConnect(ssl);<a name="line.1642"></a>
+<span class="sourceLineNo">1643</span>    }<a name="line.1643"></a>
+<span class="sourceLineNo">1644</span><a name="line.1644"></a>
+<span class="sourceLineNo">1645</span>    /**<a name="line.1645"></a>
+<span class="sourceLineNo">1646</span>     * Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS).<a name="line.1646"></a>
+<span class="sourceLineNo">1647</span>     *<a name="line.1647"></a>
+<span class="sourceLineNo">1648</span>     * @param ssl whether to enable the SSL transport<a name="line.1648"></a>
+<span class="sourceLineNo">1649</span>     * @return An Email.<a name="line.1649"></a>
+<span class="sourceLineNo">1650</span>     * @since 1.3<a name="line.1650"></a>
+<span class="sourceLineNo">1651</span>     */<a name="line.1651"></a>
+<span class="sourceLineNo">1652</span>    public Email setSSLOnConnect(final boolean ssl)<a name="line.1652"></a>
+<span class="sourceLineNo">1653</span>    {<a name="line.1653"></a>
+<span class="sourceLineNo">1654</span>        checkSessionAlreadyInitialized();<a name="line.1654"></a>
+<span class="sourceLineNo">1655</span>        this.sslOnConnect = ssl;<a name="line.1655"></a>
+<span class="sourceLineNo">1656</span>        this.ssl = ssl;<a name="line.1656"></a>
+<span class="sourceLineNo">1657</span>        return this;<a name="line.1657"></a>
 <span class="sourceLineNo">1658</span>    }<a name="line.1658"></a>
 <span class="sourceLineNo">1659</span><a name="line.1659"></a>
 <span class="sourceLineNo">1660</span>    /**<a name="line.1660"></a>
-<span class="sourceLineNo">1661</span>     * Sets whether the server identity is checked as specified by RFC 2595<a name="line.1661"></a>
-<span class="sourceLineNo">1662</span>     *<a name="line.1662"></a>
-<span class="sourceLineNo">1663</span>     * @param sslCheckServerIdentity whether to enable server identity check<a name="line.1663"></a>
-<span class="sourceLineNo">1664</span>     * @return An Email.<a name="line.1664"></a>
-<span class="sourceLineNo">1665</span>     * @since 1.3<a name="line.1665"></a>
-<span class="sourceLineNo">1666</span>     */<a name="line.1666"></a>
-<span class="sourceLineNo">1667</span>    public Email setSSLCheckServerIdentity(final boolean sslCheckServerIdentity)<a name="line.1667"></a>
-<span class="sourceLineNo">1668</span>    {<a name="line.1668"></a>
-<span class="sourceLineNo">1669</span>        checkSessionAlreadyInitialized();<a name="line.1669"></a>
-<span class="sourceLineNo">1670</span>        this.sslCheckServerIdentity = sslCheckServerIdentity;<a name="line.1670"></a>
-<span class="sourceLineNo">1671</span>        return this;<a name="line.1671"></a>
-<span class="sourceLineNo">1672</span>    }<a name="line.1672"></a>
-<span class="sourceLineNo">1673</span><a name="line.1673"></a>
-<span class="sourceLineNo">1674</span>    /**<a name="line.1674"></a>
-<span class="sourceLineNo">1675</span>     * Returns the current SSL port used by the SMTP transport.<a name="line.1675"></a>
-<span class="sourceLineNo">1676</span>     *<a name="line.1676"></a>
-<span class="sourceLineNo">1677</span>     * @return the current SSL port used by the SMTP transport<a name="line.1677"></a>
-<span class="sourceLineNo">1678</span>     */<a name="line.1678"></a>
-<span class="sourceLineNo">1679</span>    public String getSslSmtpPort()<a name="line.1679"></a>
-<span class="sourceLineNo">1680</span>    {<a name="line.1680"></a>
-<span class="sourceLineNo">1681</span>        if (this.session != null)<a name="line.1681"></a>
-<span class="sourceLineNo">1682</span>        {<a name="line.1682"></a>
-<span class="sourceLineNo">1683</span>            return this.session.getProperty(MAIL_SMTP_SOCKET_FACTORY_PORT);<a name="line.1683"></a>
-<span class="sourceLineNo">1684</span>        }<a name="line.1684"></a>
-<span class="sourceLineNo">1685</span>        else if (EmailUtils.isNotEmpty(this.sslSmtpPort))<a name="line.1685"></a>
-<span class="sourceLineNo">1686</span>        {<a name="line.1686"></a>
-<span class="sourceLineNo">1687</span>            return this.sslSmtpPort;<a name="line.1687"></a>
-<span class="sourceLineNo">1688</span>        }<a name="line.1688"></a>
-<span class="sourceLineNo">1689</span>        return null;<a name="line.1689"></a>
-<span class="sourceLineNo">1690</span>    }<a name="line.1690"></a>
-<span class="sourceLineNo">1691</span><a name="line.1691"></a>
-<span class="sourceLineNo">1692</span>    /**<a name="line.1692"></a>
-<span class="sourceLineNo">1693</span>     * Sets the SSL port to use for the SMTP transport. Defaults to the standard<a name="line.1693"></a>
-<span class="sourceLineNo">1694</span>     * port, 465.<a name="line.1694"></a>
-<span class="sourceLineNo">1695</span>     *<a name="line.1695"></a>
-<span class="sourceLineNo">1696</span>     * @param sslSmtpPort the SSL port to use for the SMTP transport<a name="line.1696"></a>
-<span class="sourceLineNo">1697</span>     */<a name="line.1697"></a>
-<span class="sourceLineNo">1698</span>    public void setSslSmtpPort(final String sslSmtpPort)<a name="line.1698"></a>
-<span class="sourceLineNo">1699</span>    {<a name="line.1699"></a>
-<span class="sourceLineNo">1700</span>        checkSessionAlreadyInitialized();<a name="line.1700"></a>
-<span class="sourceLineNo">1701</span>        this.sslSmtpPort = sslSmtpPort;<a name="line.1701"></a>
-<span class="sourceLineNo">1702</span>    }<a name="line.1702"></a>
-<span class="sourceLineNo">1703</span><a name="line.1703"></a>
-<span class="sourceLineNo">1704</span>    /**<a name="line.1704"></a>
-<span class="sourceLineNo">1705</span>    * If partial sending of email enabled.<a name="line.1705"></a>
-<span class="sourceLineNo">1706</span>    *<a name="line.1706"></a>
-<span class="sourceLineNo">1707</span>    * @return true if sending partial email is enabled<a name="line.1707"></a>
-<span class="sourceLineNo">1708</span>    * @since 1.3.2<a name="line.1708"></a>
-<span class="sourceLineNo">1709</span>    */<a name="line.1709"></a>
-<span class="sourceLineNo">1710</span>    public boolean isSendPartial()<a name="line.1710"></a>
-<span class="sourceLineNo">1711</span>    {<a name="line.1711"></a>
-<span class="sourceLineNo">1712</span>        return sendPartial;<a name="line.1712"></a>
+<span class="sourceLineNo">1661</span>    * Is the server identity checked as specified by RFC 2595<a name="line.1661"></a>
+<span class="sourceLineNo">1662</span>    *<a name="line.1662"></a>
+<span class="sourceLineNo">1663</span>    * @return true if the server identity is checked<a name="line.1663"></a>
+<span class="sourceLineNo">1664</span>    * @since 1.3<a name="line.1664"></a>
+<span class="sourceLineNo">1665</span>    */<a name="line.1665"></a>
+<span class="sourceLineNo">1666</span>    public boolean isSSLCheckServerIdentity()<a name="line.1666"></a>
+<span class="sourceLineNo">1667</span>    {<a name="line.1667"></a>
+<span class="sourceLineNo">1668</span>        return sslCheckServerIdentity;<a name="line.1668"></a>
+<span class="sourceLineNo">1669</span>    }<a name="line.1669"></a>
+<span class="sourceLineNo">1670</span><a name="line.1670"></a>
+<span class="sourceLineNo">1671</span>    /**<a name="line.1671"></a>
+<span class="sourceLineNo">1672</span>     * Sets whether the server identity is checked as specified by RFC 2595<a name="line.1672"></a>
+<span class="sourceLineNo">1673</span>     *<a name="line.1673"></a>
+<span class="sourceLineNo">1674</span>     * @param sslCheckServerIdentity whether to enable server identity check<a name="line.1674"></a>
+<span class="sourceLineNo">1675</span>     * @return An Email.<a name="line.1675"></a>
+<span class="sourceLineNo">1676</span>     * @since 1.3<a name="line.1676"></a>
+<span class="sourceLineNo">1677</span>     */<a name="line.1677"></a>
+<span class="sourceLineNo">1678</span>    public Email setSSLCheckServerIdentity(final boolean sslCheckServerIdentity)<a name="line.1678"></a>
+<span class="sourceLineNo">1679</span>    {<a name="line.1679"></a>
+<span class="sourceLineNo">1680</span>        checkSessionAlreadyInitialized();<a name="line.1680"></a>
+<span class="sourceLineNo">1681</span>        this.sslCheckServerIdentity = sslCheckServerIdentity;<a name="line.1681"></a>
+<span class="sourceLineNo">1682</span>        return this;<a name="line.1682"></a>
+<span class="sourceLineNo">1683</span>    }<a name="line.1683"></a>
+<span class="sourceLineNo">1684</span><a name="line.1684"></a>
+<span class="sourceLineNo">1685</span>    /**<a name="line.1685"></a>
+<span class="sourceLineNo">1686</span>     * Returns the current SSL port used by the SMTP transport.<a name="line.1686"></a>
+<span class="sourceLineNo">1687</span>     *<a name="line.1687"></a>
+<span class="sourceLineNo">1688</span>     * @return the current SSL port used by the SMTP transport<a name="line.1688"></a>
+<span class="sourceLineNo">1689</span>     */<a name="line.1689"></a>
+<span class="sourceLineNo">1690</span>    public String getSslSmtpPort()<a name="line.1690"></a>
+<span class="sourceLineNo">1691</span>    {<a name="line.1691"></a>
+<span class="sourceLineNo">1692</span>        if (this.session != null)<a name="line.1692"></a>
+<span class="sourceLineNo">1693</span>        {<a name="line.1693"></a>
+<span class="sourceLineNo">1694</span>            return this.session.getProperty(MAIL_SMTP_SOCKET_FACTORY_PORT);<a name="line.1694"></a>
+<span class="sourceLineNo">1695</span>        }<a name="line.1695"></a>
+<span class="sourceLineNo">1696</span>        else if (EmailUtils.isNotEmpty(this.sslSmtpPort))<a name="line.1696"></a>
+<span class="sourceLineNo">1697</span>        {<a name="line.1697"></a>
+<span class="sourceLineNo">1698</span>            return this.sslSmtpPort;<a name="line.1698"></a>
+<span class="sourceLineNo">1699</span>        }<a name="line.1699"></a>
+<span class="sourceLineNo">1700</span>        return null;<a name="line.1700"></a>
+<span class="sourceLineNo">1701</span>    }<a name="line.1701"></a>
+<span class="sourceLineNo">1702</span><a name="line.1702"></a>
+<span class="sourceLineNo">1703</span>    /**<a name="line.1703"></a>
+<span class="sourceLineNo">1704</span>     * Sets the SSL port to use for the SMTP transport. Defaults to the standard<a name="line.1704"></a>
+<span class="sourceLineNo">1705</span>     * port, 465.<a name="line.1705"></a>
+<span class="sourceLineNo">1706</span>     *<a name="line.1706"></a>
+<span class="sourceLineNo">1707</span>     * @param sslSmtpPort the SSL port to use for the SMTP transport<a name="line.1707"></a>
+<span class="sourceLineNo">1708</span>     */<a name="line.1708"></a>

[... 454 lines stripped ...]


Mime
View raw message