We are using the template code below to send email.
Code Snippet
System.out.println("Sendgrid - building message");
Email from = new Email(from);
String subject = "Sending with SendGrid is Fun";
Email to = new Email(recipient);
Content content = new Content("text/plain", "Test content");
Mail mail = new Mail(from, subject, to, content);
SendGrid sg = new SendGrid(<api_key>);
Request request = new Request();
request.setMethod(Method.POST);
request.setEndpoint("mail/send");
request.setBody(mail.build());
Response response = sg.api(request);
System.out.println("Sendgrid - " + response.getStatusCode());
System.out.println("Sendgrid - " + response.getBody());
System.out.println("Sendgrid - " + response.getHeaders());
This works in my local, but when deployed in PCF I get this error
Hi @rubenbasco, thanks for opening an issue. This doesn't seem like a library-specific issue or error, so we encourage you to contact SendGrid Customer Support.
Issue Summary
We are using the template code below to send email.
Code Snippet
This works in my local, but when deployed in PCF I get this error
Exception/Log
Is there some sort of configuration needed to be done on the Sendgrid account to allow PCF to send email (vice versa)?