SendGrid provides a Java example of using their service to send email. I'd like to use this in a little CF application I'm working on but not sure how to make a Coldfusion reference to a Java Library (https://sendgrid.com/docs/Code_Examples/java.html).
If someone has a code snippet I could review or better yet a reference link on calling a java code snippet (assuming that is what it is called), I'd appreciate it. Otherwise, I have no idea on how to get started with this. I do not know how to compile a class file so please be patient.
UPDATED 12/23:
Recap of some of the comments below that I've done since posting the question
- I downloaded a jar file provided by sendgrid and saved it to the C:\ColdFusion9\lib\sendgrid-java.jar (link to the sendgrid jar file (https://sendgrid-open-source.s3.amazonaws.com/sendgrid-java/sendgrid-java.jar) that I downloaded.
- Restarted the CF Service.
Error when calling the cfm page:
Object Instantiation Exception.
Class not found: com.sendgrid.SendGrid.Email
The error occurred in C:/ColdFusion9/wwwroot/SendGrid/index.cfm: line 4
2 :
3 : oSendGrid = createObject("java", "com.sendgrid.SendGrid").init("fakeusername", "fakepassword");
4 : oEmail = createObject("java", "com.sendgrid.SendGrid.Email").init();
5 :
6 : // e-mail details`