Solved

using curl to send large html strings in mailgun

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoresSpecial  challenge 13 40
sumHeights2  challenge 7 76
countHi challenge 25 84
White board coding practice 3 61
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now