File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/main/java/com/example/compute/mailjet Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 5050 <dependency >
5151 <groupId >com.mailjet</groupId >
5252 <artifactId >mailjet-client</artifactId >
53- <version >4.0.1 </version >
53+ <version >4.0.5 </version >
5454 </dependency >
5555 <!-- [END dependencies] -->
5656 </dependencies >
Original file line number Diff line number Diff line change 2121import com .mailjet .client .MailjetRequest ;
2222import com .mailjet .client .MailjetResponse ;
2323import com .mailjet .client .errors .MailjetException ;
24+ import com .mailjet .client .errors .MailjetSocketTimeoutException ;
2425import com .mailjet .client .resource .Email ;
2526// [END mailjet_imports]
2627
3031// [START app]
3132public class MailjetSender {
3233
33- public static void main (String [] args ) {
34+ public static void main (String [] args ) throws MailjetException , MailjetSocketTimeoutException {
3435 final String mailjetApiKey = "YOUR-MAILJET-API-KEY" ;
3536 final String mailjetSecretKey = "YOUR-MAILJET-SECRET-KEY" ;
3637 MailjetClient client = new MailjetClient (mailjetApiKey , mailjetSecretKey );
@@ -39,7 +40,8 @@ public static void main(String[] args) {
3940 sender .sendMailjet (args [0 ], args [1 ], client );
4041 }
4142
42- public MailjetResponse sendMailjet (String recipient , String sender , MailjetClient client ) {
43+ public MailjetResponse sendMailjet (String recipient , String sender , MailjetClient client )
44+ throws MailjetException , MailjetSocketTimeoutException {
4345 MailjetRequest email = new MailjetRequest (Email .resource )
4446 .property (Email .FROMEMAIL , sender )
4547 .property (Email .FROMNAME , "pandora" )
You can’t perform that action at this time.
0 commit comments