Sending Email

Email can be sent via the following methods:

Send an Email Message

../../_images/webform.png

Send using the Compose Message Form

../../_images/unified_inbox_sending_mail.gif

Send using the Unified Inbox

Send using curl
curl -H "Mailsac-Key: YOUR_API_KEY_HERE" -X POST \
https://mailsac.com/api/outgoing-messages \
-H "Content-Type: application/json" --data '{ "to":"myfriend@mailsac.com", "from": "user1@mailsac.com", "subject": "Hello Myfriend", "text": "test message from mailsac" }'

# Response
{
  "from": "user1@mailsac.com",
  "to": [
    "myfriend@mailsac.com"
  ],
  "id": "fe-3hl55xcrzgr"
}
Send using Node.js. requires npm install superagent
const superagent = require('superagent')

superagent
  .post('https://mailsac.com/api/outgoing-messages')
  .set('Mailsac-Key', 'YOUR_API_KEY_HERE')
  .send({
      to: "myfriend@mailsac.com",
      from: "user1@mailsac.com",
      subject: "Hello Myfriend",
      text: "test message from mailsac"
  })
  .then((res) => {
      console.log(res.body)
  })
  .catch(err => {
      console.log(err.message)
  })

  /*
  {
  from: 'user1@mailsac.com',
  to: [ 'myfriend@mailsac.com' ],
  id: 'fe-ipic46bqge8'
}
*/
Send using Python
import requests
from pprint import pprint

headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'}
url = 'https://mailsac.com/api/outgoing-messages'
mail = { 'to':'myfriend@mailsac.com',
         'from':'user1@mailsac.com',
         'subject':'Hello Myfriend',
         'text': 'mailsac allows for sending of email'
       }

r = requests.post(url, data=mail, headers=headers)
pprint(r.json())
'''
{'from': 'user1@mailsac.com',
 'id': 'fe-tgitrk8dbga',
 'to': ['myfriend@mailsac.com']}
'''

Allowed from addresses

The from address must be a Private Address or an address within a Custom Domains.

Sending credits

Sending Email, both replies and new messages, is available only from private addresses and private domains. Sending or replying requires mail credits.

Sent Messages Are Not Saved

Outgoing messages are not saved. They may be visible or cached temporarily by our outgoing mail services, and logged in debugging messages on Mailsac servers, but not explicitly archived by Mailsac at this time.

Sending from the API

The REST API is the preferred method for sending messages programmattically. The /api-outgoing-messages endpoint is documented in the REST API documentation.

  1. Generate an API by selecting API Keys from the Dashboard.
  2. Send email using curl or your favorite HTTP library. Code Examples

Sending with SMTP

Sending via SMTP allows email clients to send email using Mailsac.

Authentication

SMTP uses a username and password for authentication. The API key for your account can be used to send from any of your private addresses or domains. Alternatively, you can use a per private address SMTP password. The per private address SMTP password can be set through using the Dashboard -> Manage Email Addresses -> Select the POP/SMTP button next to the email address -> Select Set New Password

../../_images/pop_smtp_set_password1.png

Email Client Configuration

Configure your email client (Gmail, Apple mail, Thunberbird, Outlook, iPhone, etc) using these SMTP settings:

Hostname / Server out.mailsac.com
Email Address Private email address
Username Private email address
Password API Key or SMTP Key
Port 587
Auth Settings Password / allow plain / insecure
Encryption TLS

To configure a mail client for reading see the Reading Mail via POP3 Section.

Internal SMTP Sending

For plans with unlimited internal sending messages can be sent through Mailsac’s outbound SMTP server (out.mailsac.com). Any messages sent to a Mailsac hosted domain will not require sending credits.

Hostname / Server out.mailsac.com
Email Address Private email address or email address in a private domain
Username Private email address or email address in a private domain
Password API Key
Port 587
Auth Settings Password / allow plain / insecure
Encryption TLS