2
votes

I tried to send this by email. I tried a lot of ways and always I obteined the same thing: an error.

http://goto-21.net/campaign/htmlversion?mkt_hm=0&AdministratorID=47507&CampaignID=58&StatisticID=62&MemberID=733807&s=994508d6292a660150ccc60c3f0310d4&isDemo=0

I tried with this:

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='Excited User ' \ -F to='[email protected]' \ -F cc='[email protected]' \ -F bcc='[email protected]' \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' \ -F html=' CODE HERE ' \

And this:

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='Excited User ' \ -F to='[email protected]' \ -F cc='[email protected]' \ -F bcc='[email protected]' \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' \ --form-string html=' CODE HERE ' \

But it doesnt work...Always ''syntax error''

Anyone can help me?

Thank you!

2
Syntax error? Just that? From curl or remote server? Also, can you make you examples look less unreadable, please? - Anthony
From curl in terminal an example screenshot imagizer.imageshack.us/a/img538/3032/9RfagM.png I cant show you the example (it is too large) but... I simply paste the html where I wrote ''CODE HERE'' Is that wrong? Thank you. - Gabriel Lloret

2 Answers

2
votes

Use the following cURL command to send HTML emails using the command line. Replace the uppercase parameter with your own and you're ready to send!

curl -s --user 'api:YOUR-API-KEY' https://api.mailgun.net/v2/YOURDOMAIN/messages -F from='[email protected]' -F [email protected] -F subject='Hello World with HTML' -F html='<html><head><title>Hello</title></head><body>Hello <strong>World</strong></body></html>' -F text='Hello world'

What this does is send an email from an address attached to your domain to a receiver sending html and plain text version as a fall back!

Happy mailgunning

Best,

0
votes

the origin request is looks like:

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
    https://api.mailgun.net/v3/samples.mailgun.org/messages \
    -F from='Excited User <[email protected]>' \
    -F to='[email protected]' \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'

but you have a big X before https.

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ 
-------> X <----- https://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='Excited User ' \ -F to='[email protected]' \ -F cc='[email protected]' \ -F bcc='[email protected]' \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' \ --form-string html=' CODE HERE ' \

maybe this cause an error