I have tried a few things so far but with no success.
I modified crontab and and preceeded the command with @reboot mail.mailutils ...
I also created a .sh script, changed permission, added it to init.d modified configuration with sysv-rc-config --level 3 script on
and added the necessary line to rc.local.
I would really appreciate if you could tell me where else to look!
I just want to send an email when I boot my Ubuntu (desktop not server) and when I turn it off.
The script that I am using is not even a script is
mail.mailutils -s "subject" emailaddress <<< "message"
First, check if you can send email. I am using mailutils to send email, the way to send email is:
Second, add a systemd task to listening the boot and shutdown event.
Tips: some email provider will intercept your email, since your email account is not like a common email format.