Hello everyone!
In the last few months I've been working on a little server for home purposes (VPN, little site-project to be used in LAN, network boot PXE server and some other things).
My main objective is to learn something new, rather than build something really useful.
Yesterday I installed ssmtp on my server and configured it to use my secondary gmail address (let's say
second@gmail.com)
Everything went really fine and I was able to send an email by doing:
Code:
ssmtp first@gmail.com
First line
Second line
^Q
or
Code:
echo "First line
second line" | ssmtp first@gmail.com
The problem raised when I tried to put such a job in crontab.
I did
and added this line to crontab:
Code:
*/10 * * * * /home/user/test.sh
Where test.sh was an executable file:
Code:
#!/bin/bash
echo "FIRST TRY First line
second line" | ssmtp first@gmail.com
echo "SECOND TRY First line" | ssmtp first@gmail.com
But nothing happened... I tested crontab by replacing "/home/user/test.sh" with "echo 1 > /home/user/list" and it worked. Then I tried to put "sh /home/user/test.sh" but there was no difference.
Finally I tried executing manually the script and IT SENT THE MAIL!
I don't know what to do...