Solved

using curl to send large html strings in mailgun

Posted on 2014-02-21
4
1,328 Views
Last Modified: 2014-02-26
In mailgun site there are un example using curl to send an e-mail:

https://api.mailgun.net/v2/samples.mailgun.org/messages \
    -F from='Excited User <me@samples.mailgun.org>' \
    -F to='foo@example.com' \
    -F cc='bar@example.com' \
    -F bcc='baz@example.com' \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomness!' \
    --form-string html='<html>HTML version of the body</html>' \

if I place an html string in --form-string html larger than about 3700 characters, I have a curl error EOF before finding  "  '  "

is it possible to make something like --form-string html -d @file-with-the-html?

I control send messages from a program that can place commands in the linux prompt. If there's no solution in the command line, I ask for php example for this case.

Thank you in advance
0
Comment
Question by:pcm101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 17

Expert Comment

by:kadadi_v
ID: 39876857
0
 

Author Comment

by:pcm101
ID: 39877222
Thank you Mr. Sage,

Same problem, but did not mentioned the solution.
The problem: Using a too long string in the curl command. I'm not finding the rigth syntax to get a file contents, instead of the string content in the curl command, with an example in the specific case.
0
 

Accepted Solution

by:
pcm101 earned 0 total points
ID: 39878857
The bottleneck was before arriving in the linux shell.
My problem was resolt.
The limitation was not the limit for a string/command in a linux bash, I was trying resolve.
The strings to linux commands were truncated by my application before arriving in linux.
Writting to a linux bash before sending resolves my problem.
The way Mailgun setup the things makes reasonable limits for normal e-mail use.
0
 

Author Closing Comment

by:pcm101
ID: 39888295
In fact there was no need to reffer to file to the post request to send to the webservice for normal work conditions. I have a problem before arriving in the linux command that trunkates that command.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# application error "Parameter Is Not Valid". 3 132
Work with App store 7 90
Help Required 2 46
Do Wend Macro not working 22 56
A short article about a problem I had getting the GPS LocationListener working.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question