Mailtarget Documentation

How to use Mailtarget

Welcome to Mailtarget, where you can connect and integrate your applications, websites, or systems with email functionality.

In Mailtarget, there is 3 different way to send you emails:

  • SMTP
  • API
  • SDK

Comparation sending between SMTP, API or SDK

SMTPAPISDK
Flexible with existing appsLanguage coverageClient side validation
Open protocolAssemblyEasier to code
Language coverageScales betterMaintainable (Versioning)

Sending email via SMTP

You can try to send your emails with our SMTP. Here is the sample code, you can customize them later based on your needs:

swaks --to email@email.com --from default@sandbox.mailtarget.co --auth --auth-user= default@sandbox.mailtarget.co --auth-password=API_KEY --server smtp.mtrgt.net:587 -tls

For further information, you can read here

Sending email via SDK

To seamlessly integrate this library into our Go project, we require the Go Modules as a dependency and package management tool.

For further information, you can read here


Sending email via API

You can try to send your emails with our API. Here is the sample code, you can customize them later based on your needs:

curl --location 'https://transmission.mailtarget.co/v1/layang/transmissions' --header 'accept: application/json' --header 'Content-Type: application/json' --header 'Authorization: Bearer token' --data-raw '{ "bodyText": "Congratulation, you just sent email with mailtarget. You are truly awesome!", "bodyHtml": "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>Hello from mailtarget</title></head><body><p>Congratulation, you just sent email with mailtarget. You are truly awesome!</p></body></html>", "from": { "email": "default@sandbox.mailtarget.co", "name": "mailtarget Sandbox" }, "subject": "Hello from mailtarget", "to": [ { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" }, { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" }, { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" } ], "replyTo": [ { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" } ], "cc": [ { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" } ], "bcc": [ { "email": "RECIPIENT_EMAIL", "name": "RECIPIENT_NAME" } ] }'

For further information, you can read here