$ 0 0 Your code seems to be marking the message as read, not unread. I think you want to remove the "SEEN" flag and add the "UNSEEN" flag. --Ravi