Solved

using curl to send large html strings in mailgun

Posted on 2014-02-21
4
1,305 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
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…

840 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