An example to delete emails

  • Casey Harris

    Casey Harris - 2010-07-20

    Are there any short examples that note how to delete an email from an inbox?

  • Casey Harris

    Casey Harris - 2010-07-22

    I saw the following as an example

    // Get a reference to the folder
    vmime: : ref <vmime: : net : : folder> folder = store􀀀>getDefaultFolder ( ) ;
    folder􀀀>deleteMessage (3);
    folder􀀀>deleteMessage (2);

    What I needed was is seen in the following example:

    list = read emails from server for email ID

    i = 0

    while not end list_ do
        return_code =  process_email(list)
        if return_code == good
              message_id = get_message_id_from_email(list)   <-- ???
              delete(message_id)                                                           <-- ???
       i ++;

    For the lines with "???", how does one get the mail ID from the message? I have seen examples for "Subject", "From", "To" and even attachments - but not for mail_id….



  • Vincent Richard

    Vincent Richard - 2010-07-22


    The deleteMessage() method takes a message number in argument, not a message ID.
    Use getNumber() on the vmime::net::message object to get it.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks