email attachment v5

Post any questions regarding Installing or Upgrading Ebase, including problems starting up the Ebase Xi Server or Designer

Moderators: Jon, Steve, Ian, Dave

kotinkarwak
Ebase User
Posts: 109
Joined: Mon Sep 21, 2015 9:55 pm

email attachment v5

#1

Postby kotinkarwak » Tue Oct 13, 2015 9:05 pm

Please advice on setup/syntax

Can send emails ok but adding an attachment as per reference document fails. code as below, commented out the second send that has attachment as a test.

Code: Select all

/* Notes
http://localhost:3050/ebasetest/doc/Working_with_email.htm
*/
resources.R001Mandrill.sendmail();
//resources.R001Mandrill.sendmail('../../generatedpdfs/Kayanda Johnson_10031997.pdf');

error message
com.ebasetech.ufs.runtime.events.rhinojavascript.JavascriptExecutionHandler$RhinoScriptException: Can't find method com.ebasetech.ufs.runtime.external.api.impl.EmailResourceWrapper.sendmail(string). (mailMandrill#11)
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#2

Postby Segi » Tue Oct 13, 2015 10:52 pm

Try this:

resources.R001Mandrill.sendmail(new Array(FileServices.getWebAppRootFilePath() + "\\generatedpdfs\\Kayanda Johnson_10031997.pdf"));

This is assuming that the server is running Windows which requires double slashes. If you're using Linux/Unix/OS X replace \\ with a single /. The most important part that's needed to make it work is FileServices.getWebAppRootFilePath() because sendmail() requires the full path to the file.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#3

Postby Jon » Wed Oct 14, 2015 7:49 am

..plus sendmail takes an array of attachment paths, not just a string i.e.

Code: Select all

sendmail( ['../../generatedpdfs/Kayanda Johnson_10031997.pdf'] );
0 x

kotinkarwak
Ebase User
Posts: 109
Joined: Mon Sep 21, 2015 9:55 pm

#4

Postby kotinkarwak » Wed Oct 14, 2015 10:53 am

Thanks all for clarification.
Segi/Jon, your comments always help me learn a new way of doing things.
Regards
0 x


Who is online

Users browsing this forum: No registered users and 54 guests