Link to home
Create AccountLog in
Avatar of Daniel Pineault
Daniel Pineault

asked on

curl status

I'm trying to automate Windows 10 curl to send an e-mail.

I am successful at sending the actual email but cannot seem to find any way to get a return success/failure/output back.

I am automating through Shell -> cmd and have tried outputting to a text file both using the DOS approach '> texfile' as well as the curl command '--output textfile', but both fail to provide anything.

Is there a way to output a file with a response, status, something to confirm whether or not the command completed successfully or not?
Avatar of David Favor
David Favor
Flag of United States of America image

Whether or not you can even do this is the question.

Most systems handle mail in multiple steps.

1) Queue a message into the MTA, which will only return failure for system problems like a full disk, otherwise return will be success.

2) Once queued, the MTA's queue running will... at some point in the future... attempt a mail delivery, which might work or fail.

3) To achieve... direct message sending, where you actually get back the SMTP XXX delivery return, requires circumventing your MTA.

Use SWAKS anytime MTA circumvention is required.

You can use SWAKS, write your own tool, search for another tool.

Just be aware, when you do this... you have no queuing, so if you send a message resulting in an SMTP code != 250 success, then you must develop your own SMTP queuing/backoff/resend mechanism, or the message content will be lost.
Avatar of Daniel Pineault
Daniel Pineault

ASKER

You can most certain use curl to send emails.
What I don't get is the basic DOS > isn't respected, nor is its own --output.

This is merely an exploration of curl.  Since it is now part of Windows 10, I wanted to explore if it could be useful for automating certain things, but without being able to return its output, it is pretty much useless.

I have plenty of alternative techniques available, but wanted to explore this one and was hoping I was overlooking some simple command options ... to make it work.  It is part of the OS so no extra installation required, no need for IT departments approval at clients, ... this is why I was playing around and inquiring.
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer