3 batch Email processor, included from batchcom
7 // menu for fields could be added in the future
12 <?php
html_header_show();?
>
13 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
14 <link rel
="stylesheet" href
="batchcom.css" type
="text/css">
16 <body
class="body_top">
17 <span
class="title"><?php
xl('Batch Communication Tool','e')?
></span
>
19 <span
class="title" ><?php
xl('Email Notification Report','e')?
></span
>
24 $email_sender=$_POST['email_sender'];
25 $sent_by=$_SESSION["authId"];
26 $msg_type=xl('Email from Batchcom');
28 while ($row=sqlFetchArray($res)) {
30 // prepare text for ***NAME*** tag
31 $pt_name=$row['title'].' '.$row['fname'].' '.$row['lname'];
32 $pt_email=$row['email'];
34 $email_subject=$_POST['email_subject'];
35 $email_body=$_POST['email_body'];
36 $email_subject=ereg_replace('\*{3}NAME\*{3}', $pt_name, $email_subject );
37 $email_body= ereg_replace('\*{3}NAME\*{3}', $pt_name, $email_body );
39 $headers = "MIME-Version: 1.0\r\n";
40 $headers .= "To: $pt_name<".$pt_email.">\r\n";
41 $headers .= "From: <".$email_sender.">\r\n";
42 $headers .= "Reply-to: <".$email_sender.">\r\n";
43 $headers .= "X-Priority: 3\r\n";
44 $headers .= "X-Mailer: PHP mailer\r\n";
45 if ( mail($pt_email,$email_subject,$email_body,$headers)) {
47 echo ("<br>" . xl('Email sent to') . ": " . text($pt_name) . " , " . text($pt_email) . "<br>");
57 echo (xl('Could not send email due to a server problem. ','','<br>'). $m_error_count . xl(' emails not sent','',''));