API Services - Send email with SMTP via HTTP POST request - Send Receive Free Anonymous Emails With Attachments

Trusted by 500,000 active users a day, the No.#1 world leader in anonymous, encrypted, secured email exchange, top payment security applied and most popular domain in anonymous email exchange.

API Services - Send email with SMTP via HTTP POST request

5yMail.com kindly introduces new API Service for all users worldwide to send email by HTTP POST/GET request. The advantage of the service is to allow user to send a larger number of emails, bulk emails with HTML/Rich content. 

The integration with our API Service is completely simple for both normal internet users and developers. Only a few steps to make API work and integrated into your own system to send bulk emails.

------> YOUTUBE VIDEO GUIDELINE

To use this service, users need to have API Subscription.

1. SEND EMAIL USING HTTP POST ------> GUIDELINE VIDEO

2. SEND EMAIL WITH ATTACHMENT USING HTTP POST/FORM-DATA ------> GUIDELINE VIDEO

3. SEND EMAIL USING HTTP GET

4. GET EMAIL DETAILS BY EMAIL ID

Parameters

Parameters Required Type Description
apiKey YES A string A key generated by 5yMail API Service ater payment. To obtain apiKey at My Credits menu.
authUser YES A string An authenticate user generated by 5yMail API Service ater payment. To obtain authUser at My Credits menu.
toEmail YES A valid email address Recipient's email address, only one email supported
subject YES A string of characters without special ones. The subject of the email to be sent.
lang NO A string The language of API Service that your account created. If lang is empty or missing, the default language English( en ) will be used, meant that your account was created in English version.
Value: en, fr, es, it, de, ru, zh or vi
content YES A string Content of the email to be sent, HTML supported.
fromEmail NO A valid email address The sender address of the email to be sent. If it is empty or missing, the sender@5ymail.com is used as a default sender.
ccEmail NO A valid email address The CC address of the email to be sent.
bccEmail NO A valid email address The BCC address of the email to be sent.
fromName NO A string of characters without special ones The sender name of the email to be sent.
replyEmail NO A valid email address The email address recipient reply to. 
WARNING:
- If it is empty or missing, the reply email from recipient will route to your 5yMail's received messages. - If it is included in api request, the reply email from recipient will go to this email address.
replyName NO A string The name for replyEmail defined above.
xMailer NO A string The X-Mailer header to be included in email header.
serverLocation NO A string Specify the email server location to send the email. If it not set or empty, the email location will be selected randomly.
Value: asia, europe or usa

 

The service authentication requires the following parameters:

apiKey: Refer My Credits to obtain it.
authUser: Refer My Credits to obtain it.

 

SEND EMAIL USING HTTP POST/GET REQUEST

POST - https://service.5ymail.com/api

POST - https://service.5ymail.com/api-with-attachment

GET - https://service.5ymail.com/api

 

1. SEND EMAIL WIH HTTP POST API

POST -  https://service.5ymail.com/api

Body

{
"apiKey": "< apiKey >",
"authUser": "chalovina",
"toEmail": "5ymail.com@gmail.com",
"fromEmail": "sender@5ymail.com",
"fromName": "5yMail Team",
"subject": "The first email from API",
"content": "This is the test messages",
"ccEmail": "cc@domain.com",
"bccEmail": "bcc@domain.com",
"replyEmail": "reply@domain.com",
"replyName": "Mr John",
"xMailer": "Microsoft Outlook",
"serverLocation": "usa",
"lang": "en"
}

Response - OK 

{
    "emailId": 123456
    "message": "OK",
    "error": null
}
 

Sample POST Request with Postman

2. SEND EMAIL WIH ATTACHMENT USING HTTP POST/FORM-DATA

POST -  https://service.5ymail.com/api-with-attachment

 

Params 

Response - OK 

{
    "emailId": 123456
    "message": "OK",
    "error": null
}
 

Sample POST/Form-data with Postman

3. SEND EMAIL USING HTTP GET API

GET - https://service.5ymail.com/api

Format

https://service.5ymail.com/api?apiKey=<apiKey>&authUser=<authUser>&fromEmail=<fromEmail>&toEmail=<toEmail>&subject=<subject>&content=<content>&lang=<language>

Sample

GET -  https://service.5ymail.com/api?apiKey=apiKey&authUser=your 5ymail username&fromEmail=sender@5ymail.com &toEmail =han@google.com &subject=Test&content=TestEmail&lang=en

Sample Response - OK 

{
    "emailId": 123456
    "message": "OK",
    "error": null
}

 

Sample GET Request with Postman

4. GET EMAIL DETAILS BY EMAIL ID API

GET - https://service.5ymail.com/api/[emailId]

PARAM

  • emailId: The email ID returned in previous APIs.
  • apiKey: The API key, required.
  • authUser: The 5ymail username, required.
  • lang: The language where your account was created, Optional, default: en

Sample Request with Postman

Sample Response

{
    "emailId": 218977,
    "fromEmail": "sender@5ymail.me",
    "fromName": "Google",
    "toEmail": "test@gmail.com",
    "replyEmail": "yPwngTeGyd1861992-658697-EN@5ymail.com",
    "replyName": "Google",
    "subject": "Hello Danh Truong",
    "content": "<div>\r\n\t<div id=\"content\"><!DOCTYPE html>\r\n<html>\r\n<head>\r\n</head>\r\n<body>\r\n<p>Hello this is the test of sending an email</p>\r\n</body>\r\n</html></div>\r\n\t<div id=\"info\"></div>\r\n</div>\r",
    "ccEmail": "",
    "bccEmail": "",
    "serverLocation": "",
    "createdDateTime": "2023-12-16T01:53:58",
    "lang": "en",
    "deliveryNote": "2.0.0 (success), smtp;250 2.0.0 OK 1725056373 a640c23a62f3a-a89891c51adsi341059466b.708 - gsmtp",
    "status": "Delivered",
    "xmailler": " "
}

DOWNLOAD POSTMAN 5YMAIL API COLLECTION

 

ERROR Response

There are defined errors as following. 

1. Missing required Paramters
{
    "message": "ERROR",
    "error": "Required request parameter 'apiKey' for method parameter type String is not present"
}
{
    "message": "ERROR",
    "error": "Required request parameter 'authUser' for method parameter type String is not present"
}
{
    "message": "ERROR",
    "error": "Required request parameter 'toEmail' for method parameter type String is not present"
}
{
    "message": "ERROR",
    "error": "Required request parameter 'content' for method parameter type String is not present"
}
{
    "message": "ERROR",
    "error": "Required request parameter 'subject' for method parameter type String is not present"
}
2. Api Key is invalid
{
    "message": "ERROR",
    "error": "apiKey invalid"
}
3. AuthUser or Lang is invalid
{
    "message": "ERROR",
    "error": "Username invalid or language associated to the account invalid."
}
4. User not yet activated
{
    "message": "ERROR",
    "error": "User not yet activated."
}
5. Normal Subscription expired
{
    "message": "ERROR",
    "error": "Your Normal Subscription expired."
}
6. API Subscription is not yet activated
{
    "message": "ERROR",
    "error": "Your API Subscription not yet activated."
}
7. API Subscription is expired
{
    "message": "ERROR",
    "error": "Your API Subscription expired."
}
8. API Subscription limited
{
    "message": "ERROR",
    "error": "Account reached to limit number of emails per day. You can upgrade to API Subscription to send more emails per day."
}
9. Email is invalid
{
    "message": "ERROR",
    "error": "ToEmail invalid."
}
{
    "message": "ERROR",
    "error": "FromEmail invalid."
}
10. Unauthorized access
{
"message":
"ERROR",
    "error":"Email {emailId}: Access Denied."
}
{
    "message": "ERROR",
    "error": "Email {emailId}: Not found."
}

Our team has been trying our best to provide you the best services with different experiences. However, it's not easy to serve all of you and we would love to receive feedbacks from all of you to bring the better services.

Please don't hesitate to contact us for any information at Contact Us page.

Thank you so much!

The 5yMail team.