= 4.2.3 # 2) You must have an SMTP server running on the machine this script # is installed on. # #INSTALLATION: # 1) Set the path to the "require" statements below. If you keep all your files # in the same directory, you most likely will not have to edit the "require" statements. # 2) Set the values located in the "MailListConfigs_basic.php" # file. ALL VALUES SHOULD BE ENCLOSED IN QUOTES. # 3) Complete the "installation" section of the file "MailList_basic.php". # #RUNNING: # 1) The URL to address the Admin interface is: # http://www.yourdomain.com/scripts/MailListAdmin_basic.php?a=9 # #ADDITIONAL FEATURES AVAILABLE IN THE ADVANCED VERSION: # 1) Print the Add form to add an email to the current list # 2) Adding an email to the current list directly, bypassing any # confirmation emails # 3) Removing an email from the current list directly, bypassing any # confirmation emails # 4) Removing several emails from the current list directly, bypassing # any confirmation emails # 5) Displaying the Remove the form to remove an email from the current list # 6) Web interface to update current list settings # 7) Web interface to Create a new list # 8) Web interface to Delete a list # 9) Web interface to Update URLs # 10) Support for MULTIPLE lists # 11) Exporting mail list data to Excel, Word, and a text editor # 12) Sorting member data by email address or date joined # #More details can be found at http://www.davelozinski.com/scripts/ # #WHERE/HOW TO PURCHASE THE ADVANCED VERSION # http://www.davelozinski.com/scripts # #LICENSE: # You are free to further develop/modify the source code to fit your #needs, but you MAY NOT resell and/or redistribute the source code in any #way, manner, fashion, or form without my hand-written consent! # # This license grants the purchaser of this archive the permission to #have an unlimited number of users use this script at any time. #Likewise, the purchaser may have any number of copies of this script as long #as the media that this programs is stored on or run from is owned by the purchaser. #If not, more licenses MUST be purchased. #Examples: # 1) If you have your own webserver hosting your various customers, you only need once license #to run the code on your webserver to provide the email functionality to your clients hosted on your server. # 2) If you are designing websites for 3 individual clients, each of which wants the email functionality, #and each of which will be hosting their websites and emailer on their own server, #then you need to purchase 3 licenses. # #If you modify the source code in anyway for your own purposes, the #original header-comments must remain intact. # #REVISION HISTORY: # 3.00 07/31/04 Updated with advanced script. # 2.10 07/04/004 Updated with advanced script. # 2.00 04/12/03 Functionality improved. New features added. # 1.01 06/18/02 Corrected a mailing bug which stopped the program from emailing # every member on the list. # 1.00 03/01/02 Original Version # #CONTACT INFORMATION: # http://www.davelozinski.com/cgi-bin/email_lozinski.pl # require(preg_replace("/\w+\.php$/","",preg_replace("/" . preg_quote("\\\\") . "/","/",$_SERVER["PATH_TRANSLATED"])) . "MailListConfigs_basic.php"); ################################ #NOTHING BELOW THIS LINE SHOULD NEED TO BE CONFIGURED ################################ #Done to distinguish between a Windows OS and other OS. Windows requires #a \r\n for mail and to write to files. Other OS's only require the \n. if (preg_match("/^WIN/i",PHP_OS)) { define ("NEWLINE", "\r\n"); } else { define ("NEWLINE", "\n"); } if (array_key_exists ("a", $_REQUEST)) { $a = $_REQUEST["a"]; } else { $a = 9; } if (array_key_exists ("e", $_REQUEST)) { $e = $_REQUEST["e"]; } else { $e = ""; } if (array_key_exists ("l", $_REQUEST)) { $l = $_REQUEST["l"]; } else { $l = ""; } if (array_key_exists ("from", $_REQUEST)) { $from = $_REQUEST["from"]; } else { $from = ""; } if (array_key_exists ("message", $_REQUEST)) { $message = $_REQUEST["message"]; } else { $message = ""; } if (array_key_exists ("subject", $_REQUEST)) { $subject = $_REQUEST["subject"]; } else { $subject = ""; } $AnError = 0; $ErrorMessage = ""; $Title = ""; $Admin_Email = ""; $Email_Admin_With_List_Update = 0; $Mail_Subscribe_Thank_You_Letter = 0; $Send_HTML_Format = 0; $Mail_List_Data_File = ""; $msg_body = ""; $datestring = ""; $mailheaders = ""; $localtime = array(); $localtime = localtime(time(),1); $Title_String = "Mailing List "; if (is_numeric($a)) { $a = (int) $a; if ($a != 0 && $a != 1 && $a != 2 && $a != 8 && $a != 9) { $a = 9; } } else { $AnError = 1; $ErrorMessage = "

An error occurred. You are not accessing this script with the correct URL Query String.

See the documentation for more details.

\n"; } $Title = $C_TITLE; $Mail_List_Data_File = $C_MAIL_LIST_DATA_FILE; if (!$AnError && ($a != 9)) { $Admin_Email = $C_ADMIN_EMAIL; $Email_Admin_With_List_Update = (int) $C_EMAIL_ADMIN_WITH_LIST_UPDATE; $Mail_Subscribe_Thank_You_Letter = (int) $C_MAIL_SUBSCRIBE_THANK_YOU_LETTER; $Send_HTML_Format = (int) $C_SEND_HTML_FORMAT; $Title_String .= "for: \"" . $Title . "\"\n"; } ?> <?=$Title_String?> " . $ErrorMessage . "\n"); } else { ###No error ?>

Mail List Administrative Interface






Current Configurations for:

Mail List Abbreviation:N/A
URL for Members to add themselves to this list:
URL for Members to remove themselves to this list:Available in the advanced version
Mail List Title:
The full title for this list.
Email a "thank you" message to each new subscriber?:
Selecting "yes" will have the program email the new subscriber a "thank you" message for joining "".
Administrator's Email:
Email Admin with each list update?:
Selecting "yes" will have the program email the administrator everytime someone confirms their addition or removal from this list.
Send HTML formatted messages by default?:
Datafile for this mail list:
Full operating system path, including the file name.
NO BACKSLASHES "\"!
Examples:
F:/Inetpub/wwwroot/scripts/maillist/listdata.txt
/var/home/public_html/somedir/datafile.txt
 

Email members of:

From:

Subject:

Message:


Send as: Text  "); echo("HTML  "); ?> [Preview]


There are no members currently subscribed to the mail list \"" . $Title . "\".\n"); } } elseif ($a == 2) { #Mail the message to the members on the list. if (strcmp($subject,"") == 0) { echo ("

You need to provide a subject for your email.

\n"); } elseif (strcmp($from,"") == 0) { echo ("

You need to specify a \"from\" address for your email.

\n"); } else { if (file_exists($Mail_List_Data_File) && !(filesize($Mail_List_Data_File) == 0)) { if ( $fp = file ($Mail_List_Data_File, "r") ) { $successes = array(); $failures = array(); while (list ($num,$line) = each ($fp)) { list ($email_address,$date) = preg_split("/\|/", $line); $msg_body = ""; $mailheaders = "From: " . $Admin_Email . NEWLINE; $mailheaders .= "Reply-To: " . $Admin_Email . NEWLINE; if ($send_html_format) { $mailheaders .= "MIME-version: 1.0" . NEWLINE; $mailheaders .= "Content-Type: text/html; charset=iso-8859-1;" . NEWLINE; $mailheaders .= "Content-Transfer-Encoding: 7bit" . NEWLINE; $msg_body .= "" . $Title . "" . NEWLINE; } $msg_body .= $message . NEWLINE; $msg_body .= NEWLINE . NEWLINE . "You are receiving this email because you subscribed to: " . $Title . NEWLINE . NEWLINE; if ($send_html_format) { $msg_body .= "

"; } $msg_body .= NEWLINE . NEWLINE; if (mail(stripslashes($email_address), stripslashes($subject), $msg_body, $mailheaders)) { $successes[$email_address] = 1; } else { $failures[$email_address] = 1; } } if (count($failures) > 0 && count($successes) > 0) { echo ("Click to view members who could not be emailed.
\n"); echo ("Click to view members successfully emailed
\n"); echo ("


\n"); } if (count($failures) > 0) { echo (" \n"); echo ("

The following " . count($failures) . " members were not emailed:

\n"); foreach ($failures as $key => $value) { echo ($key . "
\n"); } } echo (" \n"); if (count($successes) > 0) { echo ("

Successfully sent an email to these " . count($successes) . " member(s):

\n"); foreach ($successes as $key => $value) { echo ($key . "
\n"); } } else { echo ("

No members were successfully emailed.

\n"); } } else { echo ("

Error! The file \"" . $Mail_List_Data_File . "\" containing the members of: " . $C_TITLE[$l] . " could not be read!

\n"); } } else { echo ("

Error! There are no members currently subscribed to the mail list \"" . $Title . "\"!

\n"); } } } elseif ($a == 8) { #Print the current list of members. if (file_exists($Mail_List_Data_File) && !(filesize($Mail_List_Data_File) == 0)) { if ( $fp = file ($Mail_List_Data_File, "r") ) { ?> \n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); } echo ("\n"); echo ("

Members:

[export]

Display:
Remove?Email AddressDate Joined
" . $email . "" . $date . "
  
\n\n"); } else { echo ("

Error. Could not open the datafile \"" . $Mail_List_Data_File . "\" for reading.

\n"); } } else { echo ("

The mail list \"" . $Title . "\" currently has no members.

\n"); } } elseif ($a == 9) { #View all current lists ?> \n"); echo ("\n"); echo ("\n"); echo ("\n"); if (file_exists($C_MAIL_LIST_DATA_FILE) && filesize($C_MAIL_LIST_DATA_FILE) != 0) { echo ("\n"); } else { echo ("\n"); } echo ("\n"); echo ("

All Mail Lists. Click on a list for specifics.

List AbbreviationList Title 
Basic Test List" . $Title . "[Update][Members]No Members
\n"); } ?>