Last active
September 15, 2023 17:21
-
-
Save james2doyle/a7222108ba7a895c1734 to your computer and use it in GitHub Desktop.
Send SMTP email using cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --connect-timeout 15 -v --insecure "smtp://smtp.example.com:25" -u "username:password" | |
\ --mail-from "[email protected]" --mail-rcpt "[email protected]" | |
\ -T email-contents.txt --ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: "Sender Name" <[email protected]> | |
To: "Destination Email" <[email protected]> | |
Subject: Sending Using Curl | |
Hello, | |
I'm sending this mail with curl. | |
Bye! |
need open port ?
How to attach file (like sss.pdf) using curl send email?
You also can try a local server with Python:
python -m smtpd -n -c DebuggingServer localhost:1025
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
For me it seems to be working but at the very end I get the error
curl: (56) Failure when receiving data from the peer
and no message is sent (or received?)