Solved

using curl to send large html strings in mailgun

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

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

Suggested Solutions

Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

751 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