This is a Java project that tests the connectivity of an email server by sending and receiving messages through a client-server architecture. It has a user interface built with Java form and can be used to troubleshoot issues with email delivery or to verify that a server is properly configured.
In order to use this project, you will need the following:
- Java Development Kit (JDK) 8 or higher
- Any Java Integrated Development Environment (IDE) such as Eclipse or IntelliJ IDEA
To use this project, follow these steps:
-
Clone the repository to your local machine.
-
Open the project in your chosen IDE.
-
Modify the following variables in the
MailClient.java
and
MailServer.java
files to match your email server and account information:
SMTP_SERVER
: the address of your email serverSMTP_PORT
: the port number for your email serverUSERNAME
: your email addressPASSWORD
: your email passwordFROM_ADDRESS
: the email address you want to send fromTO_ADDRESS
: the email address you want to send to
-
Run the
MailServer
class to start the server. -
In a separate terminal, run the
MailClient
class to start the client. -
A window with a form will appear in the client. Enter your email server and account information in the corresponding fields and click the "Send Email" button.
-
The server will receive the email and print a message in the terminal indicating that the email was received.
-
If the email is sent and received successfully, you should see a message indicating that the email was sent and received. If there is an error, it will be displayed in the client form and/or the server terminal.
- This project is intended for testing purposes only and is not intended for use in a production environment.
- The
MailClient.java
andMailServer.java
files are set up to use the SMTP login method for authenticating with the email server. If your server uses a different authentication method, you may need to modify the files accordingly.