Welcome to the Email Sending API documentation. This API allows you to send emails by providing the sender data, receiver information, subject and HTML content without any authentication. Follow the instructions below to integrate this API into your application and start sending emails seamlessly.
The base URL for accessing the Email Sending API is:
https://mailer-ritik.vercel.app
This (/send
) endpoint allows you to send an email to a specific receiver. Provide the
sender's data, receiver's
information, subject and the HTML content of the email.
Parameter | Type | Required | Description |
---|---|---|---|
sender | object | Yes | This includes name, email and app generated email password of the sender. |
receiver | string | Yes/No | The email address of the receiver. Mandatory: If only one receiver |
subject | string | Yes | The subject line of the email. |
data | string | Yes | The HTML content of the email. |
cc | Array | Yes/No | The list of email address of the receiver. Mandatory: If want to send as CC |
bcc | Array | Yes/No | The list of email address of the receiver. Mandatory: If want to send as BCC |
If the email is sent successfully, the API will respond with a 200 OK
status code and the
following JSON response:
{ "type": "success", "message": "Email sent successfully" }
If there is an error sending the email, the API will respond with an appropriate error status code and a JSON response indicating the error:
{ "type": "error", "message": "Invalid sender credentials" }
Request:
fetch("https://mailer-ritik.vercel.app/send", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ sender: { name: "Sender Name", mail: "Sender Email", password: "Sender Password" }, receiver: "Receiver Email", subject: "Your Subject", data: "Your HTML Content" }) });
Response:
HTTP/1.1 200 OK Content-Type: application/json { "type": "success", "message": "Email sent successfully" }
You have successfully learned how to integrate and use the Email Sending API. You can now start sending emails programmatically by providing the necessary data to the API. If you encounter any issues or have further questions, please contact me.
Happy emailing!