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

You need to set the cron by using cPanel >> cronjob to auto-delete the email command. By using the 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 a cronjob command. You should use the following code:

Delete command for 20 days email from the 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

The article was published on October 21, 2016 @ 11:30 PM

Leave a Comment