 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPMaster.com: Exploring PHP's IMAP Library, Part 2
by Chris Cornutt October 04, 2012 @ 10:36:22
PHPMaster.com has published the second part of their series taking you on a tour through PHP's IMAP extension and its use. In part one they introduced the extension and showed how to connect, get the folders/emails and view message contents. In this part they expand n that and show you how to work with the messages and attachments.
In the first part of this series I discussed how to connect to IMAP servers using PHP's IMAP extension. In this part we'll complete the series by discussing working with folders and reading email content. Let's get started!
He shows how to work with the "flags" set on messages (read, unread, replied, etc) - pulling them from the server and using the imap_setflag_full function to set them. There's a quick mention of deleting messages with imap_delete/imap_expunge and a section on viewing and downloading the attachments to messages.
voice your opinion now!
imap library extension tutorial series attachment flags delete
Sameer Borate's Blog: Downloading Gmail attachments using PHP
by Chris Cornutt May 08, 2012 @ 09:08:40
Sameer Borate has a quick tutorial posted to his site today about using PHP, specifically the IMAP functionality, to grab attachments off of emails from Gmail.
Automatically extracting attachments from Gmail can be important for reasons where you need to process the attached files periodically with a CRON job. Also it can be useful for automatically archiving important attachments. Below is a simple proof-of-concept plain PHP code, devoid of any object-oriented features that extracts attachments from your Gmail account. It uses PHPs imap extension to access the inbox.
His simple script opens an IMAP connection to the Gmail server and loops through your current emails (max of 16) and tries to find any that have attachments. It then extracts this part of the message, base64_decodes it, and saves the set of them to the local file system. You can download the source here.
voice your opinion now!
gmail attachment tutorial download imap
Gonzalo Ayuso's Blog: Using a stream wrapper to access CouchDb attachments with PHP
by Chris Cornutt September 06, 2010 @ 08:15:22
In his continuing look at using CouchDb as a file system, Gonzalo Ayuso has posted this third part in the group of articles about using streams to connect your scripts to the database instance.
I'm still working in my filesystem with CouchDb. After creating a library to enable working with PHP and CouchDB (see the post here), and after using Monkey Patching to override standard PHP's filesystem functions. I've created another solution now. Thanks to a comment in my last post (many thanks Benjamin) I've discovered that it's possible to create a stream wrapper in PHP (I thought it was only available with a C extension).
He includes the code for the stream connection wrapper, a pretty simple script that parses the string it's given and opens a read/write stream to the source. There's also a "url_stat" method that will return to you the size of the stream in bytes. Then you just register the wrapper and go about your normal file system calls to use the CouchDb directly.
voice your opinion now!
couchdb stream wrapper attachment tutorial
Andrew Johnstone's Blog: Emailing Attachments Exim Filters and PHP streams
by Chris Cornutt June 01, 2010 @ 08:51:28
New on his blog today Andrew Johnstone has a post about email attachments how how the combination of Exim filters and PHP streams can make things much easier for you and your application.
Using exim filters we could add attachments at the delivery stage, therefore reducing overhead in constructing and injecting data into an email. The delivery of emails varied as to whether it was feasible to send as a BCC or whether there were placeholders intended for each individual recipient. As such the following addresses the worst case scenario of attachments with placeholders intended for each individual recipient.
They show how to use a PHP script (that uses streams to pull in the file data and information) hooked into an exim_filter to streamline the attachment process. Configuration file examples are included in the post as well as the PHP source for creating the filter.
voice your opinion now!
email attachment stream tutorial exim filter
Paul Jones' Blog: Sending Mail with Solar
by Chris Cornutt July 18, 2007 @ 13:48:00
Paul Jones has posted a new tutorial about using the mail functionality of the Solar framework - the Solar_Mail and Solar_Stmp packages.
While each of these [PEAR Mail, PhpMailer, SwiftMailer, Zend_Mail] will work with Solar, the new Solar_Mail and Solar_Smtp packages work "natively", in that they support automatic configuration, locale and exception inheritance, and so on. Read on for some examples on how to use them.
In his example he sets up and sends a simple message, setting the contents of the email (sent as an HTML message). Since there's been much talk about the safety of a lot of the mailing systems in frameworks, Paul talks about how it's been secured from header injections, through safe attachments, and from a transport dependency-injection for SMTP.
There's even a method included that lets you take the SMTP information out of the script and put it into the Solar configuration file to use in the entire application.
voice your opinion now!
mail solar framework tutorial attachment header injection transport dependency mail solar framework tutorial attachment header injection transport dependency
|
Community Events
Don't see your event here? Let us know!
|