On the Developer.com website today, Jason Gilmore has a new tutorial covering a important feature of any based PHP install (unless disabled, of course) that is widely taken advantage of - sending emails.
Email plays a crucial role in website development, whether you'd like to confirm a new registrant's email address, recover a lost password, or provide prospective clients with a convenient means to contact you. [...] In this tutorial, I'll introduce you to several solutions for sending email using PHP, including PHP's native mail() function, PEAR's Mail package, and the Zend Framework.
He starts with some of the fundamentals of mail - the difference between POP3 and SMTP, Sendmail, etc - before moving on to an example of the mail function's usage. He does the same with the PEAR Mail package and the Zend_Mail component of the Zend Framework.
On the Symfony blog, there's a new post showing the answer to a common question framework users have - what's the best way to send emails from inside our framework applications.
Sending mails is a web developer's everyday task, and symfony 1.1 let you do this easier than ever using Swift Mailer. Swift Mailer is a well thought, fully featured PHP5 object library that will cover 120% of your mailing needs.
They show how to create a partial or a component in your application that generates the content for the emails and pushes that result out to the Swift Mailer application. They show the (simple) installation from a svn checkout and two examples of sending emails, one simple and another with a multipart message.
Solar fans will be happy to see (as mentioned in the latest post from Paul Jones) that all of the previous (and future) posts he's been making as tutorials on certain parts of the framework have been integrated into the Solar manual.
The translation went pretty quickly, because I wrote the original blog entries using Solar_Markdown, which converted them to HTML for the blog. Then I did some quick edits and re-converted them using Solar_Markdown_Wiki (which is the markup format for all the class API and manual entries at the Solar website).
The Zend Developer Zone has posted the fifth part of their Ajax chat tutorial series from maugrim today, picking up from the previous parts before.
One aspect of writing AJAX enabled applications is that one can no longer pass off Javascript as an afterthought. If you're intent on creating dynamic web applications using AJAX, visual effects, and funky new age interfaces then you'll just have to start recognising that Javascript is going to be a primary development language.
They show how to create and use the XMLHttpRequest object to grab the information from the backend script using a saveMessage call from a form button. When the message comes back, their handleRefresh function takes care of updating the textarea with the results.
They also include the code to allow user's to change their name on the server via the same interface (and the same controller).
If you want to write PHP scripts that handle email, there are a few things you need to understand first. This article, the first of two parts, introduces you to these concepts.
The article is an excerpt from the Zend PHP Certification Guide and focuses on some of the basics of handling email with PHP. There's some knowledge that you'll need to have before you get started, but the rest is pretty simple stuff. It's walked through at a good pace, making it easy to follow and a good beginner's resource.
Topics they discuss include working with MX records, preparing your PHP installation to handle emails, and sending an email from your script (including instructions for both Unix and Windows based systems).
In the never-ending stream of article series that comes out of DevShed, they've started up a new one today with part one of a look at creating an email client with PHP and implementing the full email functionality (reading/writing/attachments/etc).
In this four-part series of articles we are going to build an email client with PHP. I will try to implement a full email client with all the functionality that you would expect from an email client, which includes a trash folder, sent items folder and a draft folder. But that's not all.
In part one, they set things up - talking about how it will all work (using the PHPMailer class) and the creating of the database tables to store the data for the app including the messages and the user information.
On his blog today, Ammar Ibrahimrelays a story of how the Mail component from the eZ component frameowrk "saved the day" for a project he was working on.
A few days ago I was asked to develop a simple script for a solidarity campaign. The idea is that people send their photos as attachements to some email. The script would download all images attached and insert a record for that in the database.
I got introduced to eZ components during my last visit to Norway to attend the eZ systems conference. I decided to give it a shot, and oh boy it's just amazing, probably the cleanest and simplest API ever.
The Mail attachment provided all that he needed, and he includes the script (about 50 lines long) that he used to fetch the emails. He did have one issue with the ability to fetch a single email with the tool, but he managed to hack around it (script included as well).
On PHPEasyStep.com, there's a new tutorial talking about adding "send forgotten password" functionality to your member site.
Mark Jackson is one of our member but he forgot his password for login to our website. We'll send him password to his e-mail address.
In this tutorial create 2 file and 1 database - forgot_password.php, send_password_ac.php and the members database.
The rest of the tutorial is all code and SQL statements, including the HTML for the form the users fill out. Basically, it just grabs the password value from the database and sends it along in an email.
Of course, the structure is here for the application, but it's not very secure - sending the password in plain-text like that. Personally, I'd have md5 hashed passwords and reset the password to a new one each time the "request my password" was made. Then, they can come in and reset the paasword when they log in.
GMail's "for your domain" email feature has already impressed quite a bit of the industry, but have you ever wished for something a little bit more? Have you wanted to be able to send things the same way, but from a PHP script? Vulgarisoip is here to help.
Now that GMail for your domain has arrived (if you're a lucky beta winner, that is) it's like hiring a world-class email server engineer and paying them nothing. It takes a little work because of GMail's security requirements, but you end up with a rock solid email server that won't send messages straight into spam folders.
He uses the PHPMailer pakcage to do the dirty work - ensuring the headers are correct and providing a simple API for your scripts to use. There's a brief code example with a small explaination, but there's really not that much to it - any coder could integrate it easily.
DevArticles has posted part two of their "Sending Email with Ajax" series today, this time discussing the development of the client side of things.
Welcome to part two of the series "Sending email with AJAX." In three parts, this series goes through the making of a simple web-based email application. It uses AJAX as the driving technology for fetching the files responsible for sending email from the server, as well as for adding and updating contacts.
Building on the previous part, they create a few more modules - an "email sender", "contact listing", "contact insertion", and a function to get things started - initializeEmailClient. The next part of the series will wrap things up, making the server side of things to actually do the work of sending the emails...