RPA.Email.ImapSmtp problem with delete message

Hello !

I am currently working with Robot Framework for my company and I’m using the library “RPA.Email.ImapSmtp”.

I show you my code :

*** Settings ***
Library     RPA.Email.ImapSmtp    smtp_server=smtp.gmail.com    smtp_port=587 

*** Variables ***
${url_gmail}   ...
${gmail_address}   ...
${app_password_gmail}    ...
${subject}    ...

*** Tasks ***
[Documentation]    Get email with specific subject and delete it
Authorize    account=${gmail_address}    password=${app_password_gmail}    smtp_server=smtp.gmail.com  smtp_port=587
${number_of_inbox_messages}=    Select Folder    folder_name=INBOX
Log    ${number_of_inbox_messages}
@{emails}    List Messages    criterion=SUBJECT "${subject}"	
Mark As Read   SUBJECT "${subject}"
Delete Messages  SUBJECT "${subject}"

The code works fine except from “Mark As Read” and “Delete Messages”.
I have no errors in my console, the test is marked as “pass”, but the mails are not marked as read and have not been deleted.

Everything else is fine:

  • Log ${number_of_inbox_messages} tells me that I have an email in my inbox.
  • @{emails} List Messages criterion=SUBJECT "${subject}" contains this email.

Thank you in advance for your help.


Hi @b00772368 Sorry to hear about your problems with the library.

You happened to submit this issue when I was just working on the ImapSmtp library and there is now rpaframework release 11.3.0 which should address also the issues reported by you.

Can you maybe try with that version ? Also keep in mind that most of the “action” keywords return boolean value of keyword success (True) / fail (False).

1 Like

Hi Mika !

Thank you for your ansewer.

Yes it works now ! Thanks for the new version.

Have a good day !