Mailtrap Wget integration

Mailtrap can be integrated with Wget for email sending, find out how to do it.

Before we start, you’ll need to:

Send emails using Wget and Mailtrap

To integrate Mailtrap and send emails via Wget, simply copy/paste the following script into your configuration:

wget --method POST \
  --header 'Authorization: Bearer YOUR-MAILTRAP-API-KEY-HERE' \
  --header 'Content-Type: application/json' \
  --body-data $'{
    "from": {
      "name": "Mailtrap Test",
      "email": "YOUR-EMAIL-HERE"
    },
    "to": [
      {
        "email": "RECIPIENT-EMAIL-HERE"
      }
    ],
    "subject": "Hello World",
    "html": "<strong>it works!</strong>"
  }' \
  'https://send.api.mailtrap.io/api/send'

Once you copy the script, make sure to insert your Mailtrap API token in the Authorization   field as Bearer   and enter your and your recipient's emails in the from:     and to:    fields.

Note: To learn more about API integration, click here.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us