Skip to content

Instantly share code, notes, and snippets.

View manish-in-java's full-sized avatar

Manish manish-in-java

View GitHub Profile
@manish-in-java
manish-in-java / AmazonSESAppender.java
Created July 1, 2021 11:51
A Logback appender that can send log messages over email, using Amazon Web Services Simple Email Service (AWS SES).
/*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
@manish-in-java
manish-in-java / EmailService.java
Created March 8, 2019 04:55
SMTP Connection Pooling with Spring
import javax.mail.internet.MimeMessage;
import org.nlab.smtp.pool.SmtpConnectionPool;
import org.nlab.smtp.transport.connection.ClosableSmtpConnection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class EmailService {