简体   繁体   中英

How do I send the output of my Curl command to email with ssmtp?

Ok so I'm fairly new to Linux and I'm still learning as I go. Apologies I use the wrong terms and etc.

So I want my ngrok port curl output to be converted to text and send it as an email with ssmtp.

I did this: echo "$(curl localhost:4040/api/tunnels)" | ssmtp <email address> echo "$(curl localhost:4040/api/tunnels)" | ssmtp <email address>

I've received the mail but the mail is empty. What could've been the problem here? Thank you!

You need to add text to you message body:"

ssmtp "<the message content>" <email address>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM