This is a simple API built with Node.js, Express, and Nodemailer that allows you to send emails programmatically using a REST API.
This project was created to provide a simple way to send emails programmatically using Node.js and Nodemailer. It is designed to be easy to use and customize, making it a great starting point for building your own email sending functionality.
- Node.js
- Express
- Nodemailer
To send an email, send a POST request to the /api/mail
endpoint with the following JSON data:
//Example javascript code
const apiUrl = "https://gmailapi-armanidrisi.vercel.app/api/mail/";
const requestBody = {
sender: "yourmail@gmail.com",
password: "yourpass",
recipient: "receiver mail",
subject: "subject",
message: "msg"
};
fetch(apiUrl, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(requestBody)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
This project was created by Arman Idrisi.
This project is licensed under the MIT License.