Dave Fischetti wrote: > Hey Alex. I'm starting to get the hang of this now. Thanks again for the > help. I have 2 quick questions. > > If I want to delete the mail after I parse it, do I just use the > $mail->messageId as a paramater of the delete() function?
Hi Dave, You must use the message number of the mail as a parameter to the delete() function. You get the message numbers with the listMessages() function. > Also, if I wanted to redirect a complete message to a different address, > would I just compose a new message and rebuild the parts with the > forwarded content? or is there a simpler way of doing it. What is a redirect? A forwarding or a replying? You can use ezcMailTools::replyToMail() to build a reply mail from an ezcMail object, for example: <code> $set = $pop3->fetchAll(); $parser = new ezcMailParser(); $mails = $parser->parseMail( $set ); $mail = $mails[0]; $reply = ezcMailTools::replyToMail( $mail, new ezcMailAddress( '[EMAIL PROTECTED]' ) ); // then you must add the mail parts you want to include from $mail to $reply ($reply will be an empty mail with only the headers) // then send $reply with MTA or SMTP, for example: $mta = new ezcMailMtaTransport(); $mta->send( $reply ); </code> To forward an ezcMail object you can do something like this: <code> // $mail is similar as in the previous example $mail->addTo( '[EMAIL PROTECTED]' ); // then send $mail with MTA or SMTP </code> Hope this helps. Cheers, Alex. -- Alexandru Stanoi eZ Components System Developer eZ Systems | http://ez.no -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
