the coding is as below:
[php]
function compose($id,$draft='0'){
global $mod_admin,$mod_title,$db,$mainfile,$userdata;
include ("header.php");
AdminLinks();
if(!empty($draft)){
$t_result = $db->sql_query("SELECT title,content,charset FROM ".MAILING_DRAFT_TABLE." WHERE id='$id'");
list($t_title,$t_content,$t_charset) = $db->sql_fetchrow($t_result);
$t_content = stripslashes($t_content);
$t_charset = stripslashes($t_charset);
$t_title = stripslashes($t_title);
} else {
if(empty($id)) $id = '1';
$t_result = $db->sql_query("SELECT content,charset FROM ".MAILING_TEMPLATE_TABLE." WHERE id='$id'");
list($t_content,$t_charset) = $db->sql_fetchrow($t_result);
$t_content = stripslashes($t_content);
$t_charset = stripslashes($t_charset);
$t_title = "News and Update";
}
OpenTable3("96%");
echo "<br><center><div class=\"title\">COMPOSE E-MAIL</div></center><br>";
OpenTable("90%");
echo "<form method='post' name='editor' action='".$_SERVER['PHP_SELF']."'>";
echo "<table width='100%' cellspacing='0'>";
echo "<tr><td><b>FROM</b></td><td valign='top'>"
."<select name='from'>"
."<option value='".$userdata[user_email]."' selected='selected'>".$userdata[user_email]."</option>"
."<option value='webeditor@ehomemakers.net'>webeditor@ehomemakers.net</option>"
."<option value='editor@ehomemakers.net'>editor@ehomemakers.net</option>"
."<option value='project_manager@ehomemakers.net'>project_manager@ehomemakers.net</option>"
."<option value='webmistress@ehomemakers.net'>webmistress@ehomemakers.net</option>"
."<option value='web_chinese@ehomemakers.net'>web_chinese@ehomemakers.net</option>"
."<option value='web_malay@ehomemakers.net'>web_malay@ehomemakers.net</option>"
."<option value='salaamwanita@ehomemakers.net'>salaamwanita@ehomemakers.net</option>"
."<option value='project-admin@ehomemakers.net'>project-admin@ehomemakers.net</option>"
."<option value='greenliving@ehomemakers.net'>greenliving@ehomemakers.net</option>"
."</select></td></tr>";
echo "<tr><td><b>SEND TO</b></td><td valign='top'>"
."<select name='recp'>"
."<option value='myself' selected='selected'>Myself ONLY</option>";
$resultm = $db->sql_query("SELECT id,title FROM ".MAILINGLIST_TABLE);
While(list($mid,$mtitle) = $db->sql_fetchrow($resultm)){
echo "<option value='".base64_encode($mid)."'>".stripslashes($mtitle)."</option>";
}
echo "</select></td></tr>";
echo "<tr><td><b>TITLE</b></td><td valign='top'><input type='text' size='60' name='title' value='".$t_title."'></td></tr>";
echo "<tr><td valign='top'><b>MESSAGE</b></td><td valign='top'>";
//echo "<textarea name='content' cols='60' rows='30'></textarea>";
echo "</td></tr>"
."<tr><td>";
echo "<iframe width='600' id='idContent' height='600'></iframe>"
."<div id='Lyr1' style='position:absolute; visibility: hidden'><textarea name='content' cols='0' rows='0'>$t_content</textarea></div>";
echo "</td></tr>"
."<tr><td bgcolor='#efedde' align='right'>"
."<input type='checkbox' onclick='setMode(this.checked)' name='checkbox1'>Edit HTML";
echo "</td></tr></table>";
echo "</td></tr></table>";
echo "</td></tr>";
echo "<tr><td valign='top'><br /></td><td valign='top'><br />"
."<input type='radio' name='do' value='savedraft' checked='checked'><b>Save as draft</b><br />"
."<input type='radio' name='do' value='continue'><b>Proceed to send e-mail</b><br />"
."</td></tr>";
echo "<tr><td valign='top' colspan='2'><br /></td></tr>";
echo "<tr><td valign='top' colspan='2' align='center'><input type='submit' value='CONTINUE' onclick='SubmitContent();'></td></tr>";
echo "<tr><td valign='top' colspan='2'>";
echo "<input type='hidden' name='charset' value='$t_charset'>";
if(!empty($draft)) echo "<input type='hidden' name='did' value='$id'>";
echo "<input type='hidden' name='op' value='$mod_admin'>";
echo "<br /></td></tr>";
echo "<tr><td valign='top' colspan='2'>"
."<div class='content'><b>Note :</b><br />"
."- Make sure all related picture or image in the newsletter already been upload to server."
."</div></td></tr>";
echo "</table>";
echo "</form>";
CloseTable();
CloseTable3();
echo "<br /><br />";
include ("footer.php");
}
function continue_mailing($from,$recp,$title,$content,$charset){
global $mod_admin,$mod_title,$db,$mainfile,$userdata,$adminmail,$bill_path;
@set_time_limit(0);
@ignore_user_abort();
$chk_from_email = validate_email($from);
if(!$chk_from_email){
$err_msg = "Invalid Sender Email. Please provide a valid email address.";
error($err_msg);
}
if(empty($title) or empty($content)){
$err_msg = "One or more required data is missing. Please make sure all required data is filled.";
error($err_msg);
}
$headers .= "From: $from\r\n";
$headers .= "Content-Type: text/html; charset=".$charset."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Return-Path: $adminmail\r\n";
$headers .= "X-Mailer: PHP/".phpversion();
$subject = "".stripslashes($title);
$msg = stripslashes($content);
if($recp!='myself'){
if(!empty($recp)){
$result = $db->sql_query("SELECT gender,marital,age,occ,interest,subscribe FROM ".MAILINGLIST_TABLE." WHERE id='".base64_decode($recp)."'");
list($ml_gender,$ml_marital,$ml_occ,$ml_interest,$ml_subscribe,$ml_age) = $db->sql_fetchrow($result);
}
$sql_select = "SELECT DISTINCT user_email";
$sql_from = " FROM ".USERS_TABLE;
$sql_where = " WHERE user_id > 0";
if(!empty($ml_gender)) $sql_where .= " AND user_gender='$ml_gender'";
if(!empty($ml_marital)) $sql_where .= " AND user_marital='$ml_marital'";
if(!empty($ml_occ)) $sql_where .= " AND user_occ = '$ml_occ'";
if(!empty($ml_interest)) $sql_where .= " AND user_interest = '$ml_interest'";
if(!empty($ml_subscribe)) $sql_where .= " AND user_subscribe = '$ml_subscribe'";
if(!empty($ml_age)){
if($ml_age == "A") $sql_where .= " AND YEAR(now()) - YEAR(user_birthdate) <= 20";
elseif($ml_age == "B") $sql_where .= " AND (YEAR(now()) - YEAR(user_birthdate) > 20) AND (YEAR(now()) - YEAR(user_birthdate) <= 30)";
elseif($ml_age == "C") $sql_where .= " AND (YEAR(now()) - YEAR(user_birthdate) > 30) AND (YEAR(now()) - YEAR(user_birthdate) <= 40)";
elseif($ml_age == "D") $sql_where .= " AND (YEAR(now()) - YEAR(user_birthdate) > 40) AND (YEAR(now()) - YEAR(user_birthdate) <= 50)";
elseif($ml_age == "E") $sql_where .= " AND YEAR(now()) - YEAR(user_birthdate) > 50";
}
$result = $db->sql_query($sql_select.$sql_from.$sql_where);
$filename = "list_".$recp.".php";
$address_file = $bill_path.$filename;
$fd = fopen($address_file,"w+") or die("Cann't open file <b>$filename</b>.");
$fout = fwrite($fd, $adminmail."\n");
while(list($user_email) = $db->sql_fetchrow($result)) {
$fout = fwrite($fd, $user_email."\n");
}
$fout = fwrite($fd, "mylene@mimced.com\n");
} else
{
include ('header.php');
AdminLinks();
OpenTable3("90%");
if (!mail($from, $subject, $msg, $headers, "-f $from"))
echo "<center><div class=\"title\"><b>Fail to send email!</b></div></center><br />";
else echo "<center><div class=\"title\">Email successfully sent!</div></center><br />";
CloseTable3();
include("footer.php");
exit;
}
fclose($fd);
include ('header.php');
AdminLinks();
OpenTable3("90%");
echo "<br><center><div class=\"title\">CONFIRM TO SEND THIS E-NEWSLETTER ?</div></center><br>";
OpenTable("90%");
echo "<form method='post' name='sendform' action='http://ehomemakers.net/cgi-bin/mail.cgi'>";
echo "<textarea name='body' cols='80' rows='20' readonly>".stripslashes($content)."</textarea><br /><br />";
echo "<input type='submit' value='SEND EMAIL NOW'>";
echo "<input type='hidden' name='charset' value='$charset'>";
echo "<input type='hidden' name='address_file' value='$address_file'>";
echo "<input type='hidden' name='sender_uid' value='".$userdata["user_id"]."'>";
echo "<input type='hidden' name='ip' value='".getenv("REMOTE_ADDR")."'>";
echo "<input type='hidden' name='from' value='$from'>";
echo "<input type='hidden' name='subject' value='$subject'>";
echo "</form>";
CloseTable();
CloseTable3();
include("footer.php");
}
[/php]
: : i have problems in sending email in bulk.when i send email with attachment to many people at the same time, the receiver claims that the emails does not have sender's information, its empty,even the date sent also missing.but when it sent to one person, the problem does not occur.
: :
: : why is this happening?is it because of the email server or mail coding?
:
:
: Well we would have to see your code to know if that is the problem, but I would suspect it is being flagged as spam and rejected because of that. Multiple recipients and attachments...with how paranoid people have to be about email these days, unfortunately that's just asking for trouble.
: