IMAP Problem2

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 55
Joined: Thu Apr 08, 2004 4:39 pm
Location: Egypt

IMAP Problem2

Postby adly3000 » Sat Feb 11, 2006 6:29 am

i'd like to set or clear the seen flag to any selected message:

Code: Select all

if (isset($_GET['hmark']) && isset($_GET['dmsg']) && isset($_GET['fresh']))
   $dmsg = $_GET['dmsg'];
   $flagtype = $_GET['hmark'];
   $fresh = $_GET['fresh'];
   $used = isset($_SESSION['used']) ? $_SESSION['used'] : array();
   if (!isset($used[$fresh]))
      if ($flagtype=='Seen')
         fnflagmsgs($dmsg, $flagtype);
      elseif ($flagtype=='UnSeen')
         list($un, $flagtype) = explode("Un",$flagtype);
         fnunflagmsgs($dmsg, $flagtype);
      $used[$fresh] = TRUE;
      $_SESSION['used'] = $used;

1- 'hmark' is a select in the form whic will pass 'Seen'.
2- 'dmsg' is checkboxes.
3- 'fresh' is a hidden field to prevent repeatation on refreash.
the flagmsg.php contains:

Code: Select all

function fnflagmsgs($flagedmsgs, $flagtypeis)
   global $dmsg;
   global $flagtype;
   //-- open imap connection --//
   $mboxflag = @imap_open("{}", "".$_SESSION['SESSION_USER_NAME']."+".$_SESSION['SESSION_MAIL_HOST']."", $_SESSION['SESSION_USER_PASS']) or header("Location: error.php?ec=3");
   //-- delete specified message numbers --//
   for ($x=0; $x<sizeof($flagedmsgs); $x++)
   //-- close imap connection page --//

so it doesnot set or even clear the flags, why i don't know?!
hmmmm.... the greatest is that my view page set the seen flag as desired?! lol
plz plz plz help me!!! :help:

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest