Skip to content

Instantly share code, notes, and snippets.

View popnoart's full-sized avatar

Paula I. Portilla Lejarza popnoart

View GitHub Profile
@popnoart
popnoart / IMAP_access.php
Created December 29, 2022 11:27 — forked from nmcgann/IMAP_access.php
IMAP access class to decode imap body, fetch and assemble all the parts and attachments. Used as an utility class for processing a whole mailbox.
<?php
/**
* IMAP_access. Utility class for processing a mailbox for applications that
* want to grab the body text and do something with it e.g. create a new
* todo list item. Enough clues in there that it can be expanded to do
* a lot more if required - e.g. also grab file attachments.
*
* Based on several part-working tutorials (fixed), the PHP manual examples
* and testing on real email samples from Gmail, Thunderbird and MS outlook 2010.
* (flatten_parts is the tricky bit and was from here:
<\?[^=|xml|php]
<?php
@popnoart
popnoart / .htaccess
Last active August 29, 2015 14:26
PHP: Resize an image on the fly and cache it (like Drupal's ImageCache)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z]+)/([^/]*)$ resize.php?size=$1&file=$2