Skip to content

Adelakin-Adewumi/Cronjob_Mail_Setting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cronjob_Mail_Setting

I will like to take you through how to send mail using crontab. Kindly follow the steps in every folder.

  1. Update your sudo sudo apt update

  2. Install ssmtp sudo apt install ssmtp

  3. Edit sssmtp folder - there are two folders that we will edit in this part. The first one is ssmtp.conf nano /etc/ssmtp/ssmtp.conf Inside this folder, we will edit the following; root=[email protected] mailhub=smtp.mail.gmail.com:587 FromLineOverride=YES UseSTARTTLS=YES AuthUser=[email protected] AuthPass=getThisPasswordFromYourGmail(GoogleHowToGetIt) TLS_CA_File=-/cert.pem

  4. Edit the second ssmtp file nano /etc/ssmtp/revaliases Paste this in the folder yourPCUsername:[email protected]:smtp.mail.gmail.com:587

  5. Create your shell script file

example of a shell script is in script.sh

  1. Get the path of the shell script file. Edit the crontab crontab -e Set the crontab to anytime you want the mail to deliver. Example 0 * * * * will deliver the mail at 12am of everyday.

  2. Ensure your local machine(laptop, desktop, or any machine) is connected to the internet. This will let the mail deliver inside your email.

  3. Another way to send to mail is to use mail -s "mail topic" folder [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages