Skip to content

Instantly share code, notes, and snippets.

@mimepost
Last active August 14, 2019 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimepost/e239c752b3426bc82426bd144c61c83a to your computer and use it in GitHub Desktop.
Save mimepost/e239c752b3426bc82426bd144c61c83a to your computer and use it in GitHub Desktop.
Some example to send test email using MimePost

Send test email using MimePost

(by @MimePost)


Using curl

curl -XPOST \
-H 'X-Auth-Token: api_token' \
-H "Content-type: application/json" \
-d '{  
"html":"<p>This is an example html content</p>",
"subject":"This is an example subject",
"from_email":"from@example.com",
"from_name":"Sender Name",
"to":[  
  {  
    "email":"to@example.com"
  }
],
"cc":[  
  "cc@example.com"
],
"bcc":[  
  "bcc@example.com"
]
}' 'http://api.mimepost.com/v1/emails/'

Using SMTP

Installation swaks:

Linux

Debian (e.g. ubuntu):

sudo apt-get install swaks

RHEL (e.g. centos):

sudo yum install swaks

Mac

brew install swaks

Sample code:

swaks --server smtp.mimepost.com:2525 \
      --auth-user smtpuser \
      --auth-password smtppass \
      --to to@example.com \
      --from from@exmple.com

Other tools

These are few library for respective language. Every language has their SMTP library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment