public static Mail buildHelloEmail() throws IOException {
    Email from = new Email("test@example.com");
    String subject = "Hello World from the SendGrid Java Library";
    Email to = new Email("test@example.com");
    Content content = new Content("text/plain", "some text here");
    // Note that when you use this constructor an initial personalization object
    // is created for you. It can be accessed via
    // mail.personalization.get(0) as it is a List object
    Mail mail = new Mail(from, subject, to, content);
    Email email = new Email("test2@example.com");
    mail.personalization.get(0).addTo(email);

    return mail;
  }
public static Mail buildHelloEmail ( ) throws IOException { Email from = new Email ( "test@example.com" ) ; String subject = "Hello World from the SendGrid Java Library" ; Email to = new Email ( "test@example.com" ) ; Content content = new Content ( "text/plain" , "some text here" ) ; Mail mail = new Mail ( from , subject , to , content ) ; Email email = new Email ( "test2@example.com" ) ; mail . personalization . get ( 0 ) . addTo ( email ) ; return mail ; }
Minimum required to send an email