// Write Attachment to file
$fp = fopen ($attachment_dir.$localfilename, "w");
fputs ($fp, decodeBody(mime_fetch_body($imapConnection, $forward_id, $message->header->entity_id), $message->header->encoding));
// Write Attachment to file
$fp = fopen ($attachment_dir.$localfilename, "w");
fputs ($fp, decodeBody(mime_fetch_body($imapConnection, $forward_id, $message->header->entity_id), $message->header->encoding));