Gmail IMAP and Outlook behaviour RRS feed

  • Question

  • Hi,

    I  configured one gmail account to IMAP and added my add-in. When any mail is identified as Spam according to rules.

    I am changed mail subject line. At the outlook it shows SPAM for fraction of second. When outlook synchronized with again server. It shows same subject line which is at server.

    I read that gmail not allow to sent duplicates mails. Is this is the case. I didn't send the mail. I just change the subject line and Save it.


    • Edited by NehaG Friday, January 8, 2016 8:33 AM
    Friday, January 8, 2016 8:29 AM

All replies

  • Hello Neha,

    What code exactly do you use? Where and when do you run it?

    Friday, January 8, 2016 9:14 AM
  • Hello Eugene,

    When OnNewMailEx() event occur I took subject line. If any virus file is attached. I am changing subject line

    and save it again with PutMailSubject(). So when Gmail IMAP configuration is present. It change the subject line of mail but after sometimes, it synchronized with Gmail account and Show me same subject line.

    Same case if you see in other IMAP configuration. I am getting two mail one with same subject line and one with Edited subject line on browser and Outlook also contains two mails. This case is not happening with gmail.

    Thanks for reply

    • Edited by NehaG Friday, January 8, 2016 9:34 AM
    Friday, January 8, 2016 9:32 AM
  • Do you use the Save method of the MailItem class? What code exactly do you have now?
    Friday, January 8, 2016 10:21 AM
  • CComQIPtr<Outlook::_MailItem> MailItem

    CString csSubject = L"Spam" + GetMailSubject(MailItem);

    BSTR bstrSubject = ::SysAllocString(csSubject);      

    hr = MailItem->put_Subject(bstrSubject);

    hr = MailItem->Save();
    if (SUCCEEDED(hr))


    return true;

    Friday, January 8, 2016 10:31 AM
  • Hello Neha,

    Where do you run that code? Is that for NewMailEx event?

    Did you have a chance to create a VBA macro with the similar code? Do you get the same results in that case? 

    Friday, January 8, 2016 11:45 AM
  • Hello Eugene,

    Yes it is NewMailEx () event. After coming to this event . I process that mail.  I change subject line and Save that mail again. All this process are working properly. After changing subject line, it shows changed subject line. But after synchronizing with gmail server side. It show me mail with original subject.

    I just want to understand the behavior of Gmail IMAP to outlook and other domain IMAP to Outlook.

    Monday, January 11, 2016 9:28 AM
  • Hi, NehaG

    Do you use Outlook 2013? As far as I know that it seems a lot of users have run into the same curious situation: Outlook 2013 is either very slow to sync with Gmail IMAP or simply doesn't sync at all. If so,  I suggest that you could contact with Google Group may provide some additional answers.

    Saturday, January 16, 2016 8:41 AM