Jump to content
UBot Underground

can not delete email from gmail


Recommended Posts

+1. Trying to delete from a Dreamhost mailbox and the loop runs (watch it in the debugger) but the delete command appears to do nothing.

 

NVM, It started working. Ignore me. Newbie alert :).

Edited by Fabier
Link to post
Share on other sites
  • 2 weeks later...
  • 3 months later...
  • 2 months later...
  • 1 month later...

My God this topic is going on from February, in 9 months nothing has been fixed, am I right or it's only me to keep having the same problem deleting email with every account, hotmail, gmail, and other private mail servers? It seems that the delete mail function simply doesn't work at all, is there any other way to delete a mail from a mail server without to phisically make the bot to login and click the delete button?

  • Like 1
Link to post
Share on other sites
  • 1 month later...

I too am having problems with this.  I have a gmail account I created a few days ago and it only has 3 emails in the inbox, but I can't delete them using this bot code:

 

clear table(&emails)
connect to mail server("POP3 With SSL", "emailaddressgoeshere", "passwordgeshere", "pop.gmail.com", 995) {
    create table from emails(&emails)
    loop($table total rows(&verifyemails)) {
        delete email(0)
    }
}

 

That code should work, according to this thread, but it doesn't: http://www.ubotstudio.com/forum/index.php?/topic/10502-delete-all-emails-from-gmail/?p=54295

 

I did verify that the &emails table is being populated properly with all 3 messages, but the error I'm getting is: Command "DELE 1" failed: -ERR Selected message already marked for deletion.

 

But the messages never get deleted, so I'm stuck... any help would be greatly appreciated.

 

Thanks,

 

-samcro

 

Link to post
Share on other sites

I opened a support ticket regarding this and I got it to work, but not with POP3, only with IMAP, like this:

 

connect to mail server("IMAP With SSL", "YOURemailAddyHere@Gmail.com", "****************", "imap.gmail.com", 993) {
    create table from emails(&tbl_Inbox_Emails)
    loop(1) {
        set(#var_CYC_Email_CRT, $table total rows(&tbl_Inbox_Emails), "Global")
        clear table(&tbl_Output_Emails)
        loop while($comparison(#var_CYC_Email_CRT, ">", 0)) {
            decrement(#var_CYC_Email_CRT)
            divider

            divider
            delete email(#var_CYC_Email_CRT)
        }
    }
}

 

Obviously, you'll have to replace the email and password to match yours.

 

Notice that I loop the table backwards, for reasons of cleaner code.

 

You can add YOUR code (whatever you want to do with the emails) between the decrement command and the end of LOOP (between the two DIVIDER lines I placed there).

  • Like 1
Link to post
Share on other sites

I also recommend you loop the table and extract the email elements if you need them (TO, FROM, SUBJECT, BODY, etc...) from the table cells and NOT using the UB functions.

 

The table always loads the elements w/o triggering errors even when the elements are blank.

 

The separate functions, such as $email subject etc... will trigger a popup error message (basically will stop the bot) if the specified email has the field empty... and you'll have to move on by manually pressing the Continue button... bad for automation, of course.

 

Manipulating an empty table cell can be made programatically though (with various logical branches and default values)

 

Hope this helps you...

Link to post
Share on other sites

VaultBoss, thanks so much for your help!  The code works, finally!  Not sure why it doesn't with POP3, maybe it's a sync thing, but I'm fine with using IMAP.

 

Thanks again!

 

-samcro

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...