cURL Download and Upload Workflows/Send an email via SMTP

Submit an email message using SMTP.

Section: Uploads

Send an email via SMTP

bash
bash
curl --url 'smtp://mail.example.com:587' --ssl-reqd --mail-from 'me@example.com' --mail-rcpt 'you@example.com' --upload-file email.txt -u 'me@example.com:password'
Explanation

curl supports SMTP and related mail protocols.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Uploads
Upload from stdin
Pipe content into curl and upload it as request body.
OpenIn sheetbashsame section
Upload a file over SFTP
Transfer a file to an SFTP destination.
OpenIn sheetbashsame section
Upload a file over FTP
Send a file to an FTP server.
OpenIn sheetbashsame section
Append to a remote file
Append uploaded data when the protocol and server support it.
OpenIn sheetbashsame section
Retry transient failures
Retry transient connection and timeout errors.
OpenIn sheetbash1 tag match
Retry on all errors
Retry on all errors, including transient HTTP failures when appropriate.
OpenIn sheetbash1 tag match