Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5080 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

  • 2 weeks later...
Posted

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.

Posted

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.

This topic is 5080 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.