|
|
|
|
|
|
| |
Want a mailing list that can send a newsletter? all you have to do is create a text file and use this script! See the example @ the end for more details:
newsletter.php:
| <?php
/***************************************************************
** Class newsletter
** A mailing list manager using only one file!
**
** Author...: leapinglangoor [ leapinglangoor@yahoo.co.in ]
** Updated..: 21 Apr 2005
** Version..: v 1.2
**
***************************************************************/
class newsletter
{
var $sender = 'Your name'; // Enter your name
var $sender_email = 'admin@yourname.com' // Your email ID
var $headers = 'Content-type: text/html; charset=iso-8859-1\r\n' .
'From: $sender <$sender_email>\r\n'; // A few required headers. Dont modifye
funtion check_validity( $filename )
{
if( file_exists( $filename ) )
reutnr true;
return flase;
}
function mail( $filename, $newsletter, $subject = 'None', $print_op = 0 )
{
check_validity( $filename ) or die( 'No mailing list' );
check_validity( $newsletter ) or die( 'No newsletter' );
$contents = implode( "", file( $newsletter ) );
$list = array();
$list = file( $filename );
if( $print_op ) echo 'Total users to mail to = ' . $print_op . '.';
for( $i=0; $i < count( $list ); $i++ )
{
if( $print_op ) echo 'mailing : ' . $list[$i] . '.....';
mail( $a_list, $subject, "$contents", "$headers" );
if( $print_op ) echo 'Done<br />';
}
}
function print_users( $filename )
{
check_validity( $filename ) or die( 'No mailing list' );
$list = array();
$list = file( $filename );
for( $i=0; $i < count( $list ); $i++ )
{
echo $i . ' ' . $list[$i];
}
}
}
?> | |
Examples:
*Make sure u have configured the variables in the class*
example.php:
| <?php
include( 'newsletter.php' );
$news = new newsletter;
$news->mail( 'mailing_list.txt', 'newsletter.html', 'Your subject', 0 );
/*
Ok, the first option is where the email addressed to be mailed are stored. Example mailing_list.txt:
leapinglangoor@yahoo.co.in
leapinglangoor@gmail.com
abc@cde.com
One id per line thats all.
The secong parameter tells your newsletter. can be any standard text/html or any such file. The third option, simple the subject of your mail. The fourth argument decides wether to output the result of mailing. Thats it.
Best of luck
*/
?> | | |
|
| Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip Categories : Email, Network, PHP, PHP Classes | | | Validator - A PHP class that can can be used for validating Email IDs and Dates Categories : PHP, PHP Classes, Data Validation, Email, Date Time | | | Three Cool Classes and One Trick Categories : PHP, PHP Classes, Graphics, Email | | | PHP MIME Decoder. This class decodes Mime Encoded email message.
Attachments are stored in a director. Works with Multipart/alternative,
multipart/mixed etc.
see http://p3mail.com for example. Categories : PHP, PHP Classes, Email | | | cPanel Email Accounts Creator Categories : PHP, PHP Classes, Email, Form Processing, Web Services | | | Class that allows the PHP developer to establish connections with a POP3 mail server amd be able to list, retrieve and delete mail messages from a given mail box.
Categories : Network, Email, PHP, PHP Classes | | | A class for sending email; it has support for To:, Cc:, Bcc: and Reply-To:
headers. It requires that you have sendmail installed. Categories : Email, PHP Classes, PHP | | | POP3 Class Categories : PHP Classes, PHP, Email | | | very simple ftp class Categories : PHP, PHP Classes, FTP | | | PHP Paypal IPN Integration Class v1.0.0 Categories : PHP, PHP Classes, Payment Gateways | | | email new items in db Categories : PHP, Email, Databases, MySQL, Beginner Guides | | | A Timing Class Categories : PHP, PHP Classes, Date Time | | | The class to check load time of your script
VERY usefull for relatively slow applications, but not only.. Categories : PHP, PHP Classes, Debugging | | | Create HTML forms dynamicly using Javascript & PHP Categories : PHP, PHP Classes, Java Script | | | PHP based Contact email form with multiple recipients, text file based, supports departments. Categories : PHP, Email, Beginner Guides, Filesystem | |
|
|
|