Last active
December 10, 2015 06:39
-
-
Save wrongkitchen/4395935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = "index.html"; | |
if(!file_exists($file)) die("File Not Found"); | |
$bodyhtml = ""; | |
$fp = fopen($file,"r"); | |
while(!feof($fp)){ | |
$bodyhtml.=fgets($fp,4096); | |
} | |
fclose($fp); | |
//$bodyhtml = preg_replace("/[\t\s]+/","",$bodyhtml); | |
$bodyhtml = str_replace('"images/','"http://xxx.com/xxx/images/',$bodyhtml); | |
$Subject = "EDM"; | |
$array = array( | |
'[email protected]', | |
//,'[email protected]' | |
//,'[email protected]' | |
//,'[email protected]' | |
); | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; | |
$headers .= "From: SONY EDM <sony_edm@sony_edm.com.hk>"; | |
foreach($array as $idx => $to){ | |
echo "<p>Sending email to "$to"..."; | |
if (mail($to, $Subject, $bodyhtml, $headers )){ | |
echo "Message successfully sent!"; | |
} | |
else { | |
echo "Message delivery failed"; | |
} | |
echo "</p>"; | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment