changeset 1830:d72a52232f79 default tip

mail - minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 24 Sep 2024 17:17:57 -0600
parents 0eb615de1f80
children
files src/goodjava/mail/Examples.java src/goodjava/mail/Smtp.java
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/goodjava/mail/Examples.java	Sun Sep 22 20:05:54 2024 -0600
+++ b/src/goodjava/mail/Examples.java	Tue Sep 24 17:17:57 2024 -0600
@@ -12,7 +12,7 @@
 
 	private static Smtp newSmtp() throws IOException, MailException {
 		Socket socket = new Socket("smtpcorp.com",2525);
-		Smtp smtp = new Smtp(socket,"GoodJava");
+		Smtp smtp = new Smtp(socket);
 		smtp.authenticate("luan","luanhost2");
 		return smtp;
 	}
--- a/src/goodjava/mail/Smtp.java	Sun Sep 22 20:05:54 2024 -0600
+++ b/src/goodjava/mail/Smtp.java	Tue Sep 24 17:17:57 2024 -0600
@@ -30,6 +30,10 @@
 			throw new MailException(ehlo);
 	}
 
+	public Smtp(Socket socket) throws IOException, MailException {
+		this(socket,"GoodJava");
+	}
+
 	public String authenticate(String username,String password) throws IOException, MailException {
 		String s = "\0" + username + "\0" + password;
 		s = GoodUtils.base64Encode(s);