Subversion Repositories SmartDukaan

Rev

Rev 20537 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20537 Rev 20561
Line 5... Line 5...
5
 
5
 
6
public class SendGridMail {
6
public class SendGridMail {
7
 
7
 
8
	private static String API_KEY ="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";
8
	private static String API_KEY ="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";
9
 
9
 
10
	public static void sendMail() throws IOException {
10
	public static void sendMail(String mailTo, String subject, String body) throws IOException {
11
		Email from = new Email("help@saholic.com");
11
		Email from = new Email("help@saholic.com");
12
		String subject = "Sending with SendGrid is Fun";
-
 
13
		Email to = new Email("kshitij.sood@saholic.com");
12
		Email to = new Email(mailTo);
14
		Content content = new Content("text/plain", "and easy to do anywhere, even with Java");
13
		Content content = new Content("text/plain", body);
15
		Mail mail = new Mail(from, subject, to, content);
14
		Mail mail = new Mail(from, subject, to, content);
16
 
15
 
17
		SendGrid sg = new SendGrid(API_KEY);
16
		SendGrid sg = new SendGrid(API_KEY);
18
		Request request = new Request();
17
		Request request = new Request();
19
		try {
18
		try {