Sending Email with AJAX: Interacting with the Server
(Page 1 of 5 )
Here we are again. Welcome to the last tutorial of the series “Sending email with AJAX.” As you may have guessed regarding the title, this three-part series explains the development of a fairly simple AJAX-driven email client application, which offers some interesting capabilities for sending email, as well as for displaying and adding contacts, all without the need to involve page reloads.
Introduction
Recapping from the previous article, let’s go quickly over the explanation of the source code developed so far. As you’ll hopefully remember, in the second tutorial, I wrote the complete set of JavaScript functions –- called the client-side application layer -- in order to provide the program with the ability to request the PHP responsible for sending email messages, along with reading and writing new data to the XML file that stores contact information.
Although the number of defined functions that make up this AJAX application is considerable, fortunately their logic is pretty simple to grasp. Taking into account the underlying ease of the application, you can quickly expand its functionality or improve some of the existing features without having to tackle annoying updating and maintenance issues. As for most open source applications, improvements are always welcome.
Now, returning to this last installment of the series, the next step involved in the creation of the AJAX-based email client rests on writing the corresponding PHP code, which actually takes care of sending email. In order to keep the PHP snippet running fast, all the code I plan to write will be deployed as a procedural script. However, if you’re thinking of including this application as part of a larger web project, you may want to consider developing the server-side code by using an object-oriented approach.
Right, with the preliminaries out of our way, let’s start developing the corresponding PHP snippet for sending email.
Next: Sending email with PHP: developing a straightforward script >>
More HTML Articles
More By Alejandro Gervasio