| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/admin/ |
Upload File : |
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require("configure.php"); ?>
<?
//print_r($_POST);
$nemailsubject = $_POST["emailsubject"];
$emaildesc = $_POST["emaildesc"];
$emaildesc = str_replace("\\\"", "\"", $emaildesc);
$emaildesc = str_replace("\\", "\\", $emaildesc);
$emaildesc = str_replace("'", "\'",$emaildesc);
//echo $emaildesc;
$emailaddress = $_POST['custemailaddress'];
$len = count($_POST['custemailaddress']);
//echo "loopnum".$len."<br>";
echo "Loading...............";
$INCLUDE_DIR = "";
$to = "";
require($INCLUDE_DIR . "class.phpmailer.php");
error_reporting(E_ALL);
//$countemail=1;
for($i=0;$i<$len;$i++) {
if (substr($emailaddress[$i],0,2) == 'G_') {
$emailaddress2 = substr($emailaddress[$i],2);
$result1 = mysql_query("SELECT * from emailgroup inner join custemail on emailgroup.emailgroupid = custemail.emailgroupid where custemail.emailgroupid = '".$emailaddress2."' ");
while ($row1 = mysql_fetch_array($result1,MYSQL_ASSOC))
{
//echo ', '.$row1{'custemailaddress'};
$cmail=$row1{'custemailaddress'};
//$numid=$row1{'custemailid'};
$body = '<HTML>';
$body .= '<HEAD>';
$body .= '<TITLE>NEWS LETTER</TITLE>';
$body .= '<META http-equiv=Content-Type content=text/html; charset=UTF-8>';
$body .= '<link rel="stylesheet" type="text/css" href="http://www.pathways.org.hk/css/style.css" />';
$body .= '</HEAD>';
$body .= '<body>';
//$body .= ''. $numid .'';
$body .= ''. $emaildesc .'';
$body .= '<br><br>';
$body .= '<table width="800" border="0" cellpadding="0" cellspacing="0">';
$body .= ' <tr>';
$body .= ' <td height="50" align="center" class="footertxt">Copyright © 2010 The Pathways Foundation Ltd. All Rights Reserved. | Sponsored by <a href="http://www.onesolution.com.hk" target="_blank">One Solution Limited</a>.<br />';
$body .= ' <a href="http://www.onesolution.com.hk" target="_blank"><img src="http://www.pathways.org.hk/images/webicon137w23h.jpg" width="137" height="23" border="0" /></a></td>';
$body .= ' </tr>';
$body .= '</table>';
$body .= '</BODY>';
$body .= '</HTML>';
$FromEmail="info@pathways.org.hk";
//$to=$custemailaddress;
$to=$cmail;
$FromName="Pathways Foundation";
$subject=$nemailsubject;
$x_mail = new PHPMailer();
$x_mail->IsSMTP();
//$x_mail->Host = "smtp2.onesolution.com.hk";
$x_mail->Host = "localhost";
$x_mail->SMTPAuth = true;
$x_mail->charSet = "utf-8";
$x_mail->From = $FromEmail;
$x_mail->FromName = $FromName;
$x_mail->AddAddress($to);
$x_mail->WordWrap = 50;
$x_mail->IsHTML(true);
$x_mail->Subject = $subject;
$x_mail->Body = $body;
$x_mail->Send();
}
} else {
//echo $emailaddress[$i];
$body = '<HTML>';
$body .= '<HEAD>';
$body .= '<TITLE>NEWS LETTER</TITLE>';
$body .= '<META http-equiv=Content-Type content=text/html; charset=UTF-8>';
$body .= '<link rel="stylesheet" type="text/css" href="http://www.pathways.org.hk/css/style.css" />';
$body .= '</HEAD>';
$body .= '<body>';
$body .= ''. $emaildesc .'';
$body .= '<br><br>';
$body .= '<table width="800" border="0" cellpadding="0" cellspacing="0">';
$body .= ' <tr>';
$body .= ' <td height="50" align="center" class="footertxt">Copyright © 2010 The Pathways Foundation Ltd. All Rights Reserved. | Sponsored by <a href="http://www.onesolution.com.hk" target="_blank">One Solution Limited</a>.<br />';
$body .= ' <a href="http://www.onesolution.com.hk" target="_blank"><img src="http://www.pathways.org.hk/images/webicon137w23h.jpg" width="137" height="23" border="0" /></a></td>';
$body .= ' </tr>';
$body .= '</table>';
$body .= '</BODY>';
$body .= '</HTML>';
$FromEmail="info@pathways.org.hk";
//$to=$custemailaddress;
$to=$emailaddress[$i];
$FromName="Pathways Foundation";
$subject=$nemailsubject;
$x_mail = new PHPMailer();
$x_mail->IsSMTP();
//$x_mail->Host = "smtp2.onesolution.com.hk";
$x_mail->Host = "localhost";
$x_mail->SMTPAuth = true;
$x_mail->charSet = "utf-8";
$x_mail->From = $FromEmail;
$x_mail->FromName = $FromName;
$x_mail->AddAddress($to);
$x_mail->WordWrap = 50;
$x_mail->IsHTML(true);
$x_mail->Subject = $subject;
$x_mail->Body = $body;
$x_mail->Send();
}
/*echo $countemail;
$countemail++;*/
}
$sql3 = "select max(emailcontentid) as maxid ";
$sql3 .= "from emailcontent";
$result3=mysql_query($sql3);
$row3 = mysql_fetch_array($result3,MYSQL_ASSOC);
$emailcontentid = $row3{maxid}+1;
$emaildate = date("F j, Y, g:i a");
$sql3 = "insert into emailcontent (emailcontentid, emailsubject, emaildesc, emaildate) values ('$emailcontentid', '$nemailsubject', '$emaildesc', '$emaildate')";
mysql_query($sql3);
//echo $sql3;
mysql_close($dbh);
header("Location: emailcontentindex.php?msg=Update Successful");
?>