SendMail
Web SEND MAIL
An easy way to send emails from your WEB page using JQuery, Angular, React, NodeJS or from any application that can send HTTP requests.
API for email sending. Use with WEB applications or automated messages within your application.
RESTful web service:
Method: POST
Url: https://q-ube.com:37525/sendmail/
Authorization: one of two
- JWT (header)
- APIKEY (body request)
Request Body: (as JSON object)
- from - The e-mail address of the sender. (required)
object {"name":"from name","address":"from@address.ext"} - sender - An e-mail address that will appear on the Sender:
object {"name":"sender name","address":"sender@address.ext"} - to - An array of recipients e-mail addresses that will appear on the To: (required)
object {"name":"to name","address":"to@address.ext"} or string "to@address.ext" - replyTo - An e-mail address that will appear on the Reply-To: (required)
string "replyto@address.ext" - subject - The subject of the e-mail (required)
- text - The plaintext version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
- html - The HTML version of the message as an Unicode string, Buffer, Stream or an object {path: '...'} (required TEXT or HTML)
- attachments - An array of attachment objects
- messageId - Optional Message-Id value, random value will be generated if not set
- date - Optional Date value, current UTC string will be used if not set
- encoding - Optional transfer encoding for the textual parts
- textEncoding - Sets explicitly which encoding to use for text parts (quoted-printable or base64). If not set then encoding is detected from text content (mostly ascii means quoted-printable, otherwise base64)
Response: (as JSON object)
Done: status code 200
{"error":false"message":"OK"}
Error: status code 401
{"error":true,"err:":<error object>}
Sample body command:
{"from":{"name":"Admin","address":"<test@tsbo.eu>"},
"sender":{"name":"Popescu Ion","address":"<popescu@example.com>"},
"to":{"name":"Adrian","address":"<adrian@gmail.com>"},
"replyTo":"adrian@nedcosafe.com",
"subject":"Test email - MSAS", "html":"<p>Hello world</p>",
"apikey":"A84UIIIHUHIH"}
or
{"from":"test@tsbo.eu","to":"<adrian@qbis.ro>","replyTo":"adrian@nedcosafe.com","sender":{"name":"AP","address":"popescu@qbis.ro"},"subject":"Test email - MSAS","html":"<p>Hello world !!</p>","apikey":"A84UIIIHUHIH"}
From address domain name should be one of the platform public domain names, same set within your APIKEY, the address is verified against spam with the DNS SPF TXT record by the receiver server, it should folow anti spam policies to protect the sending service to be black listed.
Gmail, Yahoo and a lot of others mail servers will check the SPF record and eventually block your email or at least put into SPAM if the SPF record does not match.
Allowed domain names: tsbo.eu , httpsa.com , webshello.com , webcentral.eu
sample RESTClient command and response