Renamed smtp client and fix non flushing issue
This commit is contained in:
parent
7664b4bf00
commit
16f3d6fc60
4 changed files with 40 additions and 6 deletions
2
test/zutil/net/smtp/EmailTest.java
Normal file → Executable file
2
test/zutil/net/smtp/EmailTest.java
Normal file → Executable file
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
import java.util.GregorianCalendar;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static zutil.net.smtp.SMTPClient.NEWLINE;
|
||||
import static zutil.net.smtp.SmtpClient.NEWLINE;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2017-01-19.
|
||||
|
|
|
|||
31
test/zutil/net/smtp/SmtpClientTest.java
Executable file
31
test/zutil/net/smtp/SmtpClientTest.java
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
package zutil.net.smtp;
|
||||
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Sends a test email with SmtpClient class.
|
||||
*
|
||||
* @See <a href="https://nilhcem.github.io/FakeSMTP/">Fake SMTP Server</a>
|
||||
*/
|
||||
public class SmtpClientTest {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
||||
LogUtil.setGlobalLevel(Level.ALL);
|
||||
|
||||
SmtpClient smtp = new SmtpClient();
|
||||
smtp.send("from@example.com",
|
||||
"to@example.com",
|
||||
"Test email",
|
||||
"Disregard this email");
|
||||
smtp.send("from2@example.com",
|
||||
"to2@example.com",
|
||||
"Test 2 email",
|
||||
"Disregard this email");
|
||||
smtp.close();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue