This Go program allows you to analyze the sentiment of an email and send an automatic response using the Gmail SMTP server. It utilizes the "sentiment" package for sentiment analysis and the "net/smtp" package for email communication.
Before running the program, ensure that you have the following:
- Go programming language installed on your system.
- A Gmail account for sending the automatic response.
- The email content stored in a file.
-
Clone the repository:
git clone https://github.com/RayMune/Gmail-Bot.git
-
Build the executable:
go build
-
Run the program:
./email-sentiment-analysis email_content.txt
Replace
email_content.txt
with the path to your email content file. -
The program will analyze the sentiment of the email content and print the sentiment and score to the console.
-
An automatic response will be sent to the recipient's email address specified in the code. Ensure you have provided valid Gmail credentials and valid recipient email address.
To customize the program, you can modify the following:
- Gmail credentials: Replace
[email protected]
with your Gmail email address andMyPassword
with your account password. - Automatic response: Modify the subject and content of the email in the
e.Subject
ande.Text
fields, respectively. - Sentiment analysis: If needed, you can customize the sentiment analysis logic in the code by using a different sentiment analysis package or implementing your own sentiment analysis algorithm.
- The program currently only supports Gmail's SMTP server. If you want to use a different email provider, you will need to modify the SMTP settings accordingly.
- The sentiment analysis algorithm used in the "sentiment" package may have its own limitations and accuracy constraints.
Contributions to the project are welcome. If you have any improvements or suggestions, please submit a pull request or open an issue on the repository.