Skip to content

Instantly share code, notes, and snippets.

@sgyyz
Created February 2, 2019 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgyyz/8f6bc8c13fd942ab4e8cd00b7dae26df to your computer and use it in GitHub Desktop.
Save sgyyz/8f6bc8c13fd942ab4e8cd00b7dae26df to your computer and use it in GitHub Desktop.
email-spring-boot-starter example
public class GreetingService {
@Autowired
private EmailService emailService;
public void sendEmail() {
try {
Map<String, Object> ctx = ImmutableMap.of("name", "Mr. Smith");
emailService.sendHtmlMail("Sender <sender@somecompany.com>", "greeting", Locale.CHINESE, ctx, "Mr. Smith <smith@somedomain.com>");
} catch (MessagingException e) {
// ignored
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment