Skip to content

Instantly share code, notes, and snippets.

@sgyyz
Created February 2, 2019 02:54
Show Gist options
  • 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 <[email protected]>", "greeting", Locale.CHINESE, ctx, "Mr. Smith <[email protected]>");
} catch (MessagingException e) {
// ignored
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment