CURL Sendmail via bash
bash, curl, email, smtp
Solution
It looks like it's having problems to find the file contents. What about using a here-string to avoid writing a file at all? Change your code to:
curl -n --ssl-reqd --mail-from "me@lupetto.sh" --mail-rcpt "my mail" -T - --url smtps://smtp.gmail.com:465 --user "example@gmail.com:password" <<<"Password changed $(date)"
Notice the `echo` statement removal, the here-string at the end of the line and the `-T -` to get the file from stdin.
Problem
Hi i've a problem whit this code: ``` # up here there's more code echo "Password changed" $(date) > lez.txt curl -n --ssl-reqd --mail-from "me@lupetto.sh" --mail-rcpt "my mail" -T lez.txt --url smtps://smtp.gmail.com:465 --user "example@gmail.com:password" ``` If I run the script I get only a empty mail, but if I do this manually I get my mail. Thanks.