Subversion Repositories SmartDukaan

Rev

Rev 20531 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20531 Rev 20537
Line 12... Line 12...
12
		String subject = "Sending with SendGrid is Fun";
12
		String subject = "Sending with SendGrid is Fun";
13
		Email to = new Email("kshitij.sood@saholic.com");
13
		Email to = new Email("kshitij.sood@saholic.com");
14
		Content content = new Content("text/plain", "and easy to do anywhere, even with Java");
14
		Content content = new Content("text/plain", "and easy to do anywhere, even with Java");
15
		Mail mail = new Mail(from, subject, to, content);
15
		Mail mail = new Mail(from, subject, to, content);
16
 
16
 
17
		SendGrid sg = new SendGrid(System.getenv(API_KEY));
17
		SendGrid sg = new SendGrid(API_KEY);
18
		Request request = new Request();
18
		Request request = new Request();
19
		try {
19
		try {
20
			request.method = Method.POST;
20
			request.method = Method.POST;
21
			request.endpoint = "mail/send";
21
			request.endpoint = "mail/send";
22
			request.body = mail.build();
22
			request.body = mail.build();