News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Exploring PHP's IMAP Library, Part 2
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.

0 comments voice your opinion now!
imap library extension tutorial series attachment flags delete


Sameer Borate's Blog:
Downloading Gmail attachments using PHP
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.

0 comments voice your opinion now!
gmail attachment tutorial download imap


PHPMaster.com:
Creating a Mobile Photo Blog, Part 1
October 06, 2011 @ 08:35:57

PHPMaster.com has started up a new series of tutorials today with part one of "Creating a Mobile Photo Blog". The set of tutorials will show you how to create a simple blogging tool that will upload images as submitted via an email address.

This is the first article in a two-part series in which I will show you how to create a photo blog as part of your personal website which you can update from your phone simply by sending an email. You'll write a script to check the inbox of an email account for new messages using POP3; the script will extract the messages' subject line, body text, and attachments and update a database accordingly. You can then pull the information from the database for display on your blog, in a sidebar, or however else you see fit.

The start with some of the security considerations you'll need to keep in mind when creating a script like this depending on how open you want it to be (like filtering based on the "From" email or sending an approval message before posting). Included in the post is the SQL to create their basic tables for posts, image details and the pending items. There's also a PHP class (POP3) that makes an IMAP connection to a remote server, authenticates as your account and fetches the latest messages along with their attachments. These are pulled with a quick script and displayed via a foreach.

Part two will get into more of the integration of the images and the approval technique prior to posting the images.

0 comments voice your opinion now!
tutorial photo blog imap email approval


Reddit.com:
How do you test email when in development?
August 31, 2011 @ 12:58:53

In this recent post to Reddit, a question is asked that's an issue for many developers testing the email sending abilities of their applications - how can it be tested effectively without outside services flagging you as a possible spammer.

So how do you guys do it? My current solution is to just output the email template HTML straight to the browser, but this doesn't always work. [...] I have considered sending emails through to my GMail, but I run my tests quite often and I'm not sure Google would be too happy with the amount I send. [...] I'm sure there's a better way I can handle this without modifying my code too much. Suggestions appreciated.

Suggestions from the comments include:

  • a local SMTP/IMAP server configured to catch all emails being sent
  • Changing the address based on an environment flag
  • Using "@example.com"
  • Saving the email as a .msg file for later review

There's also suggestions of other Mac or Windows software to mimic the mail server like smtp4dev and MockStmp

2 comments voice your opinion now!
test email recommendation server imap stmp windows osx


PHPBuilder.com:
Downloading and Parsing Gmail Messages in PHP
September 01, 2010 @ 09:21:04

New on PHPBuilder.com today there's a tutorial showing you how to download and parse messages from Google Mail. In their case it's grabbing and parsing submissions from a form.

Some friends of mine publish a literary journal that accepts submissions via email. At their request I wrote a script to download messages from the journal's Gmail account and do some simple parsing tasks. Most of the submissions are made using an HTML form and a corresponding mailer script on their website, so I knew the precise format of the incoming messages (see Figure 1). What I didn't know was how to access Gmail in PHP.

He tried out the libgmailer script first, but ran into roadblocks until he realized he could use something PHP already had - the imap functions. With these he shows how to make a connection to the Gmail servers, get the listing of messages and pull out the body for the one you want to parse.

1 comment voice your opinion now!
gmail google mail parse imap tutorial


WebReference.com:
Build Your Own PHP Web Mailer
August 11, 2010 @ 10:56:49

On WebReference.com today there's a new tutorial about creating a PHP interface for sending and receiving emails directly from a mailer script.

In this tutorial you will learn how to create your own PHP Web mailer. You will learn the necessary steps for creating an email account and making connections to the server protocols for sending and receiving email. You also will get a listing of PHP commands that you can use to customize the Web mailer to your specifications.

The script makes manual connections to the servers instead of using something like mail and sends the raw commands to send via an SMTP server and fetch over a POP3 connection. There's also an example of making an IMAP connection and sending commands to get the current list of messages, current status and fetch the messages.

0 comments voice your opinion now!
web mailer tutorial imap stmp pop3


SugarCRM Developers Blog:
Enabling IMAP support under OS X Leopard
August 28, 2008 @ 12:05:01

John Mertic passed along a note about a new post to the SugarCRM developers blog detailing how to enable IMAP support for PHP on an OS X machine.

With the release of Mac OS X 10.5 Leopard last fall, Apple (finally) included a modern version of PHP (currently version 5.2.6 as of this writing). [...] However, the default install of PHP that Apple included didn't include all of the available PHP extensions. Most notable is the IMAP extension, which is used in SugarCRM for the Campaigns and Emails modules. However you can build this extension and have it loaded dynamically, without affecting the rest of the default PHP install.

He shows where to get the packages and libraries you'll need to get the support working. The method involves building a shared module and including it to be loaded in your php.ini. This way it doesn't disrupt anything the current build has and you don't have to recompile everything over again.

0 comments voice your opinion now!
imap support leopard osx shared module compile


PHP.net:
Update to PHP 5.2.6 Release (XSL & IMAP)
May 06, 2008 @ 08:49:05

The PHP group has made a two quick updates to the recent release of PHP 5.2.6 for the Windows users out there:

The Windows installers and archives were missing the XSL and IMAP extensions.

These updated packages can be downloaded from the Downloads page on PHP.net as usual (with each updated package having a note indicating the change).

0 comments voice your opinion now!
xsl phpnet update imap extension windows installer


PHP-GTK Community Site:
an IMAP Client & Screenshots with Gdk
December 11, 2006 @ 09:04:00

On the PHP-GTK Community site today, there's two new posts - one dealing with a simple IMAP client and the other with using Gdk to grab a screenshot.

First up, the IMAP client:

Teak is an IMAP mail client written in php-gtk1. It supports multiple IMAP mail servers. Version 0.5, announced 2002-07-24, is supposed to include database folder support, sending using an external SMTP server, a slightly smarter looking GUI.

You can check out the client for yourself by downloading it from SourceForge.

Next up is the tutorial - a quick look at a script that, with the help of the Gdk functionality, will pull in a capture of your current screen and push it into a "pixbuf" variable for you to manipulate however you'd like.

0 comments voice your opinion now!
phpgtk gdk screenshot tutorial teak imap client phpgtk gdk screenshot tutorial teak imap client



Community Events





Don't see your event here?
Let us know!


refactor series wordpress developer configure testing laravel install podcast community threedevsandamaybe opinion language list unittest code interview framework introduction release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework