Hey Alex. I just realized I can set the message to delete after being
fetched using:
$set = $pop3->fetchAll($deleteFromServer = true);
When testing it, I got this error however:(see below). Can you tell
me what might be causing this. I'm stumped.
Fatal error: Uncaught exception 'ezcMailTransportException' with
message 'An error occured while sending or receiving mail. The POP3
server could not delete the message: -ERR Invalid message number. .'
in /usr/include/php/ezcomponents-2007.1/Mail/src/transports/pop3/
pop3_transport.php:475 Stack trace: #0 /var/www/vhosts/domain.com/
httpdocs//phpcgi/inboxManager.php5(198): ezcMailPop3Transport->delete
('<20070724181601...') #1 {main} thrown in /usr/include/php/
ezcomponents-2007.1/Mail/src/transports/pop3/pop3_transport.php on
line 475
On Jul 27, 2007, at 5:56 PM, 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?
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.
Thanks a lot.
Dave
On Jul 24, 2007, at 12:30 PM, Alexandru Stanoi wrote:
Dave Fischetti wrote:
WOW alex. I KNEW their had to be a different and MUCH BETTER way
to do this.
Now if I wanted to move the file from the /tmp folder to say an
images directory or even into the database itself, Can I do that
within the loop. or does it have to happen sooner before its parsed?
It should happen before the script ends, because the /tmp files
created by the parser are deleted then. So in the loop is the
perfect place:
<code>
// ...
if ( get_class( $part ) === 'ezcMailFile' )
{
echo "Attachment: " . $part->fileName;
copy( $part->fileName, '/home/images/' . basename( $part-
>fileName ) ); // or to database
}
</code>
--
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components