PHPBuilder - multiple mail sending program

RSS Twitter

multiple mail sending program

by: ahsan rauf
April 10, 2001

Version: beta 1.0

Type: Sample Code (HOWTO)

Category: File Management

License: GNU General Public License

Description: a script to send mails reading from 2 different files make emails.dat file for email addresses make temp.dat file for the material to be delivered change the mail server name to your mail server name and thats all enjoy !!!

<table width="75%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr bgcolor="#999933"> 
      <div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="3"><b>Mail 
        Sending Process <? echo "Sending file $news to users" ?> </b></font></div>

    if  (file_exists ($news)){
     $file = fopen($news, "r");
	$file2 = fopen("emails.dat", "r");	
     if (!$file) {
       echo "<p>Unable to open remote file.\n";
     if (!$file2) {
       echo "<p>Unable to open remote file.\n";
while (!feof($file)) {
       $customerservicemail_content = $customerservicemail_content . fgets($file, 1024); }
while (!feof($file2)) {
       $line = fgets($file2, 1024); ?>

<div align="center"> 
  <table width="75%" border="2" cellspacing="0" cellpadding="0">
    <tr bgcolor="#CCFFCC"> 
      <td><? echo "Sending mail to :>> $line"; 
	$mail_subject = "Customer Service Request ";
	$customer_Support_mail = $line;
	$from_mail_address = "";
	$headers = "From: Acropolis staff\n";
	$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; 

	if(!mail("$customer_Support_mail","$mail_subject", "$customerservicemail_content","$headers")) echo "<hr> Mail cannot be send <hr>";


	echo "<br>" ?> 
        <div align="center"></div>
        <div align="center"></div>

<? }

		echo "The file $news does not exist"; ?> 
<div align="center"><a href="index.php3">Send more mails</a> </div>

Comment and Contribute

Your comment has been submitted and is pending approval.

ahsan rauf



(Maximum characters: 1200). You have characters left.