Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
85
rated 0 times [  86] [ 1]  / answers: 1 / hits: 19697  / 11 Years ago, sun, april 14, 2013, 12:00:00

I'm trying to make a script that automatically deletes e-mails from a certain sender immediately and permanently, as Gmail only allows for a filter which sends an e-mail to trash for 30 days. Please do not suggest that the default filter is enough, as for my situation, it is vital that I do not know that I was sent an e-mail from this sender.



My current script looks like this:



function deleteForever(labelName) {
var threads = GmailApp.search(in:trash label: + labelName);
for (var i = 0; i < threads.length; i++) {
threads[i].moveToTrash(); // Where I would need a delete forever trigger
}
};


However, I have been unable to figure out a way to use a GmailThread and to delete it permanently as there does not exist a function for this purpose. I was looking to see if there was a way I could finish the task using JavaScript, but have been unable figure out a method.



Does anyone have an idea how I can set these e-mails to delete themselves permanently when received?


More From » gmail

 Answers
10

It is not possible, by design, to delete an email permanently using GmailApp.


[#78925] Friday, April 12, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristiano

Total Points: 652
Total Questions: 94
Total Answers: 108

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;