I am creating an application in which I need to delete mail using IMAP in gmail. But when I set the flag to delete the message moves to spam folder instead of trash or directly deletion. Is there any way to move message to trash?
UPDATE
Now my messages are moving from inbox to important folder. I'm sending message to my self( in web browser) and it's marked as important by default.