In this post, we want to discuss about a nice function to auto delete email on cPanel. Before we get started, if you want to know about open multiple tab one click, please go through the following article: Open multiple tab on button click in C#.

You need to set the cron by using cPanel >> cronjob to auto delete email command. By using following command you can delete the 20 days old emails. Make sure you replace {USER} with your actual cPanel Hosting account username.  Let’s create cronjob command. You should use the following code:

Delete command for 20 days email from index
Example: delete inbox email

If you had an email account named info @techaid24.com and wanted to have all the emails in that inbox that are older than 7 days deleted…

Delete command for 30 days email from all folder

If you wanted to have all emails inside your mail directory including sent mail, spam, etc. that are older than 30 days deleted…

Example: delete all email

If you had an email account named info @techaid24.com and wanted to have all the emails in your sent-mail folder that are older than 21 days deleted…

Don’t forget to change {techaid24.com} to your actual domain name !

auto delete email on cPanel

Leave a Comment