I'm able to send the following field as cURL through an email api and it works from a Mac standalone, and a slightly reformated version below also works from a windows standalone. However, only the first line of [[body]] is sent, and everything after the 1st return is ignored. If I replace my returns with "" in [[body]] then it is sent OK. I've tried replacing returns with CR and CRLF and LF and nothing works. I've even tried textencode()
curl -s --user "api:apikey" https://api.mailgun.net/v3/.../messages -F "from=[[emailfrom]]" -F "to=[[tUserName]]" -F "subject='[[emailSubject]]'" -F "text='[[emailbody]]'"
Any ideas?
trouble with returns in windows cURL
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: trouble with returns in windows cURL
It's ok. Figured it out. You cant have returns in cURL in windows, so you need to fornat as HTML using <br> for returns and then send the email as html rather than text.
-
- VIP Livecode Opensource Backer
- Posts: 190
- Joined: Sat Apr 08, 2006 7:55 am
- Location: Lübbecke, Germany
- Contact:
Re: trouble with returns in windows cURL
Hm, is it possible that mailgun expects the returns as LF? I am wondering if using LF as line delimiter in the text and saving the file as binary to hard disk (URL "binfile:....) and then using the path to that file as input for the text would allow plain text.You cant have returns in cURL in windows
Code: Select all
curl -s --user "api:apikey" https://api.mailgun.net/v3/.../messages -F "from=[[emailfrom]]" -F "to=[[tUserName]]" -F "subject='[[emailSubject]]'" -F "text='[[emailbody]]'"
Code: Select all
URL "binfile:<Path to your textfile>