Skip to content

Instantly share code, notes, and snippets.

@XTechnology-TR
Forked from mimepost/email_send.md
Created November 7, 2024 16:29
Show Gist options
  • Save XTechnology-TR/9b86a2a39ab0f13eae9060efc4af1746 to your computer and use it in GitHub Desktop.
Save XTechnology-TR/9b86a2a39ab0f13eae9060efc4af1746 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":"[email protected]",
"from_name":"Sender Name",
"to":[  
  {  
    "email":"[email protected]"
  }
],
"cc":[  
  "[email protected]"
],
"bcc":[  
  "[email protected]"
]
}' '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 [email protected] \
      --from [email protected]

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