cURL with $runapplescript

Michael Mantkowski michaelj at
Fri Jan 26 13:49:55 EST 2018


We are only looking at using this method because we are still on Omnis and the Omnis SMTPsend command does not work on newer MacOS versions.

Normally we use Kelly's TCPTalk to get over this issue.  But we have recently gotten a client the requires STARTTLS email.  Kelly is looking into how to support that with TCPTalk but in the mean time we are looking for an alternative.  This cURL method seems to work, but if we cannot get information on why a failure happens it is going to be hard to support.

If we were on Omnis 8 we would just use the Omnis SMTPSend command from within Omnis itself.

Michael Mantkowski
ClienTrax Software

-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at] On Behalf Of Das Goravani
Sent: Friday, January 26, 2018 11:47 AM
To: OmnisDev List - English <omnisdev-en at>
Subject: Re: cURL with $runapplescript

Michael, I don’t have help for you, I want to leach this code for the same purpose, sending email Do you know how to add an attachment to it, could you show that, know I’m asking a lot, sorry Is CURL something I need or something I already have, I’m on a Mac, latest OS

> On Jan 26, 2018, at 8:09 AM, Michael Mantkowski <michaelj at> wrote:
> We are using the code below to run cURL on the Mac to send a email.  
> It works fine when all your input is correct.  But if you have a 
> incorrect password for instance, then the "Result" field is returned 
> and empty and the lvError is 1753.
> Does anyone know how to make it return the status information from 
> cURL even if the command is not successful?  I want to use that to 
> help the user know what is wrong.
> Begin text block
> Text: curl -s -S --verbose --url
> 'smtp[pick(pSecure,'','s','')]://[pHostName]' --ssl (Carriage return)
> Text: --mail-from '[pSenderEmail]' (Carriage return)
> Text: --mail-rcpt '[pRecipientEmail]' (Carriage return)
> Text: --upload-file [MessageFilePathPOSIX] (Carriage return)
> Text: --user '[pUserName]:[pPassword]' (Carriage return)
> Text: 2>&1     ;; Outputs STDERR to STDOUT.  Verbose uses STDERR.
> Applescipt returns STDOUT
> End text block
> Get text block Command
> Do replaceall(Command,kCr,kSp) Returns Command     ;; Replace carriage
> returns with spaces to correct the formatting of the command.  Text 
> blocks in omnis dont allow leading or trailing spaces
> Calculate AppleScript as con("do shell script ",kDq,Command,kDq) Do 
> $runapplescript(AppleScript,Result) Returns lvError Calculate 
> pTranscriptOut as Result
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
> _____________________________________________________________
> Manage your list subscriptions at

Manage your list subscriptions at

More information about the omnisdev-en mailing list