Skip to content

Instantly share code, notes, and snippets.

@james2doyle
Last active September 15, 2023 17:21
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save james2doyle/a7222108ba7a895c1734 to your computer and use it in GitHub Desktop.
Save james2doyle/a7222108ba7a895c1734 to your computer and use it in GitHub Desktop.
Send SMTP email using cURL
curl --connect-timeout 15 -v --insecure "smtp://smtp.example.com:25" -u "username:password"
\ --mail-from "sender@example.com" --mail-rcpt "destination@example.com"
\ -T email-contents.txt --ssl
From: "Sender Name" <sender@example.com>
To: "Destination Email" <destination@example.com>
Subject: Sending Using Curl
Hello,
I'm sending this mail with curl.
Bye!
@M0H4MM33D
Copy link

need open port ?

@eggypandiangan
Copy link

How to attach file (like sss.pdf) using curl send email?

@alecvinent
Copy link

You also can try a local server with Python:

python -m smtpd -n -c DebuggingServer localhost:1025

@oalimerko
Copy link

is there any way how to send emails with high priority?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment