I successfully sent emails via sendgrid's SMTP api, without change to my spring-lemon code. I did it just by configuring environment variables on cloudfoundry.
I would now like to use sendgrid java library
I then created the following class
SendGrid sendgrid = new SendGrid('api_key');
SendGrid.Email email = new SendGrid.Email();
email.addTo("example@example.com");
email.setFrom("other@example.com");
email.setSubject("Hello World");
email.setText("My first email with SendGrid Java!");
try {
SendGrid.Response response = sendgrid.send(email);
System.out.println(response.getMessage());
}
catch (SendGridException e) {
System.err.println(e);
}
How do I get spring-lemon to use this class instead of SmtpMailSender ?