You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This SMTP Service was made as an alternative use of local SMTP commands, like when your application server hasn't commands to execute a SMTP service or you don't had permission to install 3rd party software.
4
+
5
+
6
+
## How to run
7
+
8
+
This is a simple Java Standalone application, so you only need Java 1.7+ installed on your environment to execute it. The command to do it is the next:
9
+
10
+
java -jar <pathToJar>/JavaSMTPService.jar
11
+
12
+
By default the jar search for the default configuration file called "defaultSMTP.conf", to create it use the next command and set all information needed to call a SMTP Service:
**NOTE:** Attributes in brackets **[]** are optional.
34
+
35
+
## How it works
36
+
37
+
You need to execute the jar from the application you need to use a SMTP service, the jar will read the configuration file and invoke a SMTP service inside and send the email with the registered information inside the file. The jar will return an exit code 0 if email was successfully send it or an error code and message error like this:
Copy file name to clipboardExpand all lines: src/main/java/com/bahamut1797/smtp/Main.java
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -43,15 +43,15 @@ public static void main(String[] args) {
43
43
if (!smtpFile.exists()) {
44
44
System.out.println("File \"defaultSMTP.conf\" not found. Run with \"configure\" command to create it.");
45
45
System.out.println("Run \"help\" command for more information.");
46
-
System.exit(107);
46
+
System.exit(101);
47
47
}
48
48
49
49
// Run the service
50
50
sendMail(smtpFile);
51
51
} else {
52
52
// HELP Command
53
53
if (args[0].equalsIgnoreCase("help")) {
54
-
System.out.println("Read a file <filePaht> as a parameter, if you omitted, reads the file created by \"configure\" command called \"defaultSMTP.conf\".");
54
+
System.out.println("Read a file <filePath> as a parameter, if you omitted, reads the file created by \"configure\" command called \"defaultSMTP.conf\".");
55
55
System.out.println("The configuration parameters for SMTP comunication file are:");
0 commit comments