Mass Email Sending API

PAID
By Useful API | Updated a month ago | Email
Health Check

N/A

README

The following is documentation for an API that allows for the sending of emails to a list of recipients using the Flask-Mail library. The API takes in several parameters including a file path, subject, body, sender, and mail server credentials. The file path should contain a list of email addresses in either a CSV or XLS file format. If the file path contains a google drive link, the API will use the link to download the file.

The API first extracts all email addresses from the provided file and then checks if the email addresses are valid using the email_validator package. Any invalid email addresses are skipped and not included in the list of recipients. The valid email addresses are then used to send an email with the provided subject and body. The email is sent using the provided mail server credentials. The API returns a JSON object containing a message indicating the number of emails sent successfully, the list of skipped recipients, and the number of skipped recipients.

Endpoint:
/send_email

Method:
GET

URL Parameters:
file_path: (string) path to the file containing the list of email addresses
subject: (string) subject of the email
body: (string) body of the email
sender: (string) sender email address
mail_server: (string) mail server address
mail_port: (string) mail server port
mail_username: (string) mail server username
mail_password: (string) mail server password

Success Response:
Code: 200
Content:
{
“message”: “Email sent successfully to recipients”,
“skipped_recipients”: [list of skipped email addresses],
“skipped_count”:
}

Error Response:
Code: 400
Content:
{
“error”: “file_path, subject, body, mail_server, mail_port, mail_username and mail_password are required”
}
OR
Code: 400
Content:
{
“error”: “only .csv or .xls files are allowed”
}
OR
Code: 400
Content:
{
“error”: “No valid email addresses found”
}

Note:
The API has a maximum limit of 500 email addresses that can be extracted from the provided file.
The API uses the Flask-Mail library and email_validator package for sending emails and email validation respectively.
The API requires the file path to be a valid file path on the server where the API is running, or a valid google drive link.

Followers: 0
API Creator:
Rapid account: Useful API
Useful API
aviation1988
Log In to Rate API
Rating: 5 - Votes: 1