This tutorial will teach you how to make a simple newsletter in PHP/MYSQL with account activation. This will require PHP that is not running in SAFE_MODE or PHP that at least allows the sendmail function(duh, you can't send mail without this enabled).
We are using in this tutorial Xajax a very powefull and easy to use PHP Class library which makes it possible to execute a PHP script using XML and some JavaScript code. Get the latest Xajax library here.
The goal of this tutorial is to demonstrate how to generate and send emails in PHP.
So, you want to send automated email messages from your PHP application.
This can be in direct response to a user's action, such as signing up for your site, or a recurring event at a set time, such as a monthly newsletter.
Sometimes email contains file attachments, both plain text and HTML portions, and so on.
To understand how to send each variation that may exist on an email, we will start with the simple example and move to the more complicated.
Sending a Simple Text Email
Sending HTML Email
Sending Email with Attachments
This is a recipe for a 'simple yet powerful' mail form. Copy the highlighted areas and save them as 4 files as shown. Or download the zip file. Replace "John Doe" with your real name and email address. Style to your liking. Your address will neither be visible on any page nor detected by spambots.
You will receive the mail marked as coming from the form, and your guest will automatically receive a copy of the mail (s)he sent (provided correct email address is entered).
Only 2 fields are required; if 'Name' is left blank, 'Sender' will be sender's email address, and if 'Subject' is left blank, the mail will still get to your mailbox
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.