Search code examples
linuxcurldevopssystem-administrationserver-administration

Sending email via curl in Linux


i am using command below for sending emails via curl in a linux docker container.

curl ${REPORT_SMTP_SERVER} --mail-from ${REPORT_MAIL_FROM} --mail-rcpt ${REPORT_MAIL_TO} --upload-file error.txt

This command works pretty well and emails are sent.I was wondering is there any way how to send those emails with high priority?Unfortunately did not find any flag for that in curl documentation.


Solution

  • Your error.txt can include something like this :

    From: "User Name" <[email protected]>
    To: "John Smith" <[email protected]>
    X-Priority: 1
    Subject: This is a test
    
    Hi John,
    I’m sending this mail with curl.