/var/www/(Del)pathways.org.hk/admin/testemail.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
ini_set
('display_errors'1);
error_reporting(E_ALL);
 require(
"configure.php"); ?>

<?
//print_r($_POST);

$nemailsubject            'test';
$emaildesc                'testing';
$emaildesc str_replace("\\\"""\""$emaildesc);
$emaildesc str_replace("\\""\\"$emaildesc);
$emaildesc    str_replace("'""\'",$emaildesc);
//echo $emaildesc;
$emailaddress  = array('hudsonhui@onesolution.com.hk''khimhk@gmail.com');
$len          count($emailaddress);

//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++) {
        
        
$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";
        
//$FromEmail="info@onesolution.com.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->Host = "192.168.11.39";
        //$x_mail->Host = "175.45.19.82";
        
        //$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;
        if (!
$x_mail->Send())
        {
            echo 
'Error: ' $x_mail->ErrorInfo;
        }
    
    
/*echo $countemail;
    $countemail++;*/
    
}



mysql_close($dbh);


//header("Location: emailcontentindex.php?msg=Update Successful");
?>