curl can be used to send emails with SMTP
21sys
32 points
2 comments
July 18, 2026
Related Discussions
Found 5 related stories in 306.0ms across 14,015 title embeddings via pgvector HNSW
- Email could have been X.400 times better maguay · 44 pts · April 23, 2026 · 43% similar
- TIL: You can make HTTP requests without curl using Bash /dev/TCP mrshu · 352 pts · June 16, 2026 · 43% similar
- purl: a curl-esque CLI for making HTTP requests that require payment bpierre · 16 pts · March 21, 2026 · 42% similar
- Curl 8.21.0 robin_reala · 12 pts · June 24, 2026 · 42% similar
- Show HN: Throwaway – open-source disposable email checker and API weddpros · 11 pts · April 30, 2026 · 42% similar
Discussion Highlights (2 comments)
ratg13
Interesting and good to be aware of When on a random CLI though my personal preference though is still to use telnet as the commands are easily memorized and there’s something more natural about typing the email out and then sending it.
mmh0000
I use this in all the various little bash scripts I have running via timers. I love curl. local email_body=$(cat <<- PANCAKE From: ${SMTP_FROM} To: ${SMTP_TO} Subject: BACKUP SCRIPT FAILED $0 backup script failed on ${HOSTNAME} Exit code: ${exit_code} Failed at line: ${line_number} $(journalctl -o cat --user _SYSTEMD_INVOCATION_ID=${invocation_id} || true) PANCAKE ) ## TODO: see above # Send email via authenticated SMTP using curl echo "${email_body}" | curl -s --url "${SMTP_URL}" \ --ssl-reqd \ --mail-from "${SMTP_FROM}" \ --mail-rcpt "${SMTP_TO}" \ --user "${SMTP_USERNAME}:${SMTP_PASSWORD}" \ --upload-file - }