Noél Dubau Posted January 6, 2016 Share Posted January 6, 2016 (edited) Hello, I don't discover Scriptmaster plugin but I'm disappointed to day. FileMaker 12 ADV and Mavericks on an iMac 27 i5. I put the pi in the extensions folder ; I opened Scriptmaster.fmp12 file and went on The sendEmail with attachments and ran successfully. I asked to Register Function by copying to clipboard RegisterGroovy( "SendEmailWithAttachments( from ; to ; subject ; body ; smtpHost ; attachmentPath )" ; "import javax.mail.*;¶ import javax.mail.internet.*;¶ ¶ Properties props = new Properties();¶ props.setProperty(\"mail.smtp.host\", smtpHost);¶ ¶ MimeMessage msg = new MimeMessage(Session.getInstance(props));¶ Multipart content = new MimeMultipart();¶ // first the message body¶ MimeBodyPart bodyPart = new MimeBodyPart();¶ bodyPart.setText(body, \"UTF-8\");¶ content.addBodyPart(bodyPart);¶ // then the attachment¶ 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.send(msg);¶ return true"; "isGui=false" ) I opened my fmFile and added in the opening script a line Set variable [$sendEmail ; Value : RegisterGroovy( "SendEmailWithAttachments( from ; to ; subject ; body ; smtpHost ; attachmentPath )" ; "import javax.mail.*;¶ import javax.mail.internet.*;¶ ¶ Properties props = new Properties();¶ props.setProperty(\"mail.smtp.host\", smtpHost);¶ ¶ MimeMessage msg = new MimeMessage(Session.getInstance(props));¶ Multipart content = new MimeMultipart();¶ // first the message body¶ MimeBodyPart bodyPart = new MimeBodyPart();¶ bodyPart.setText(body, \"UTF-8\");¶ content.addBodyPart(bodyPart);¶ // then the attachment¶ 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.send(msg);¶ return true"; "isGui=false" ) No error message ; I closed scriptMaster.fmp12 and my file and reopened it : and I have a lot of errors I dont understand (see screencopy) Hope in your help to unblind my eyes ! Noël Ashamed ! I just found I hadn't load jars.... But now I get the following message : Hope your help ! Thanks Edited January 6, 2016 by Noél Dubau near by the solution.... Link to comment Share on other sites More sharing options...
ryan360Works Posted January 6, 2016 Share Posted January 6, 2016 Hi Noél, Are you getting the NullPointerException when opening your solution or when you try to use the function? Can you send me your logs? Please see this page for log locations. Please be sure to replicate the error before sending without any restarts of FileMaker as this will overwrite the logs. You can send the logs to [email protected] . Once I have those I should have a better idea as to what is going on. Link to comment Share on other sites More sharing options...
Noél Dubau Posted January 6, 2016 Author Share Posted January 6, 2016 (edited) Hello I'm sorry to have disturb by that question ! I've found my problem : the function required jars and I hadn't load them ! Regards Noël How can I mark the question solved ? Edited January 6, 2016 by Noél Dubau Link to comment Share on other sites More sharing options...
ryan360Works Posted January 6, 2016 Share Posted January 6, 2016 No worries! I'm glad you got it figured out! Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3033 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 accountSign in
Already have an account? Sign in here.
Sign In Now