Hi guys. am new to php. Got the below php mailing list script online. However, it sends out messages to emails that are in this format : . How do i configure it to send out messages to emails without the open and close tags? just simply email address without the tags. help plz
<? error_reporting(0); //############################################################# //################# CONFIGURATION ########################## // choose a password $my_password="RUlhY7M6dh"; // the email from which emails are send // mydomain.com must be your real domain, otherways, // the server will not send any emails $from_email="John Smith "; // Your replay to email (whatever you want). $replayto="[email protected]"; // A message to be attached to the bottom of the message // We recommend to add a link to subscription page $message_at_bottom=" ------------------------------------------------------------ P.D.: To remove from this list go to... http://www.mydomain.com/emaillist/ "; // The file where emails are stored $emails_file="emaillist-RUlhY7M6dh.txt"; //############### END CONFIGURATION ######################## //############################################################# // IF INFO IS NOT POSTED, PRINT THE FORM AND DIE if (!$_POST["mensaje"]){ print_form(); die(); } // IF INFO IS POSTED YOU WILL BE HERE // Check whether the password is correct // (only webmaster is supposed to know the password, which has been specified above) if ($_POST["p"]!=$my_password){die("Incorrect password");} // Get the subject of message $subject =$_POST["subject"]; // Get the body of message $message=$_POST["mensaje"]; // Add to body of message the bottom $message.=$message_at_bottom; // Read the file with emails to variable $emails_file $emails_file=file_get_contents($emails_file); // Extract list of emails to array $emails_array preg_match_all("/<.{0,100}?>/",$emails_file,$emails_array);// Start output
print “Sending messages…”;
// Send email to each email
foreach ($emails_array[0] as $email){
// remove “<” and “>” from each email
$email=substr($email,1,strlen($email)-2);
// Next line is the one sending the email: the key command of this script
mail($email, $subject, $message,“From: $from_email\nReply-To: $replayto\nContent-Type: text/plain”);
// Each time an email is send, output it
print “
$email\n”;
// After sending each email, send previous line (the email) to the browser
flush();
}
?>
<?php // THIS FUNCTION WILL SHOW THE FORM // MODIFY IT AS REQUIRED function print_form(){ ?> My email listForm to send email to the mailing list
Subject
Message Password |