Don’t connect if already connected.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 31 Jul 2014 11:13:05 +0000 (13:13 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 31 Jul 2014 11:13:05 +0000 (13:13 +0200)
src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java

index b781f4d..cedde47 100644 (file)
@@ -105,7 +105,9 @@ public class EmailAction implements Action {
                        addHtmlPart(output, multipart);
                        message.setContent(multipart);
 
-                       transport.connect();
+                       if (!transport.isConnected()) {
+                               transport.connect();
+                       }
                        transport.sendMessage(message, message.getAllRecipients());
                } catch (MessagingException me1) {
                        /* swallow. */