Solved

using curl to send large html strings in mailgun

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

809 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