December 26, 201015 yr I am trying to smtp thru Zimbra, which requires port 465, and SSL but when I edit the groovy code to use Port 465, it freezes ( beach ball ) It does work thru Outlook Express, so the account info is correct greg
January 4, 201115 yr scriptmaster's built-in email module doesn't support SSL. You will need to use our Email plugin, which I think i responded to your question about already.
January 7, 201115 yr Author Thanks. I wasted a *lot* of time on this, but did learn something Scriptmaster is an amazing tool, if you have the patience to find the right code I found the Groovy code for Gmail also works for Zimbra thru Scriptmaster, and appears to use SSL greg import javax.mail.*; import javax.mail.internet.*; Properties props = new Properties(); props.put("mail.transport.protocol", "smtps"); //props.setProperty("mail.smtp.host", smtpHost); props.put("mail.smtps.host", smtpHost); props.put("mail.smtps.auth", "true"); MimeMessage msg = new MimeMessage(Session.getInstance(props)); Multipart content = new MimeMultipart(); // first the message body MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(htmlBody, "text/html"); content.addBodyPart(bodyPart); // then the attachment if (attachmentPath) { MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(attachmentPath); content.addBodyPart(attachmentPart); } msg.setContent(content); msg.setSubject(subject); msg.setFrom(new InternetAddress(from)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to)); //Transport transport = Session.getDefaultInstance(props).getTransport("smtp"); Session mailSession = Session.getDefaultInstance(props); mailSession.setDebug(true); Transport transport = mailSession.getTransport(); //int port = -1; // use the default port //int port = 587; // use the alt port, e.g. AOL int port = 465; // use the Zimbra port //int port = 25; transport.connect(smtpHost, port, username, password); transport.sendMessage(msg, msg.getAllRecipients()); transport.close(); return true >scriptmaster's built-in email module doesn't support SSL. You will need to use our Email plugin, which I think i responded to your question about already.
Create an account or sign in to comment