tags:

views:

830

answers:

3

I want to create a script in php to read al mail from a mail acount. I connect to the server, I can see the mails but went I want to seet it back to unseen I can't find a function to do this.

+1  A: 

If I understand this page correctly:

http://www.php.net/manual/en/function.imap-body.php

You can use the FT_PEEK option to leave the message as 'unread'.

EDIT AFTER YOU COMMENTS

Have you looked at this method?:

http://www.php.net/manual/en/function.imap-clearflag-full.php

You are able to clear the \\Seen flag.

Rew
I know this. But if see the body and than I return to index.php how can I set it back to unseen ?
Emanuel
I'm sorry - I don't understand exactly what it is you're trying to do. Can you give a step by step explanation?
Rew
In any mail client (Yahoo Mail, GMail ...) you have this options: "Mark as unread", "Mark as read". How can be done something like this in php?
Emanuel
A: 

Roll your own. You should learn about socket() and the IMAP protocol.

Martin Hohenberg
A: 

Hi this is not the answer for your question. I am trying to do the same what you have achieved but i could not even read any messages of my gmail account so can you assist me how you did using php. i am using xampp 1.7.2 and imap of that xampp..

pradeepa