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
SMTP | API | SDK |
Flexible with existing apps | Language coverage | Client side validation |
Open protocol | Assembly | Easier to code |
Language coverage | Scales better | Maintainable (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 protected] \
--from [email protected] \
--auth --auth-user= [email protected]\
--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": "[email protected]",
"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