Hi
I am trying to send a reminder mail with the HTML Table format. But the details is not getting displayed. Please help me to fix.
i am using class file to send the email.
include ('config.php');
date_default_timezone_set('Asia/Calcutta');
require "classemail.php";
$mail = new EMail;
$mail->Username = 'emailid';
$mail->Password = 'password';
$today_data = '2016-02-03';
$stmt = "SELECT * FROM reminder_scheduler,reminder_execution WHERE RCE15STST='Y' and RCE15SID=EXE15SID and EXE15STST is null and EXE15NXTRDT=?";
$params = array($today_data);
$query = sqlsrv_query( $conn, $stmt, $params);
$mContent = '';
echo $mcontent .=
"<div style='width:600px; margin:0px auto;'>
<div style='width:560px; height:auto; border-left:1px solid #dfdfdf; border-right:1px solid #dfdfdf; padding:20px 20px; background-color:#f7f7f7; float:left;'>
<table style='font-family:Arial; font-size:12px;' width='560px' border='0'>
<tr>
<td colspan=3>
<span style='color:#2A4E98; font-weight:bold;'>Hi</span>
</td>
</tr>
<tr>
<td align=left colspan=3><span style='font-family:Arial; font-size:12px; color:#000000;text-indent:40px;'></span></td>
</tr>
<tr>
<td align=left colspan=3> </td>
</tr>
<tr>
<td align=left colspan=3><b><u>Reminder for Payment Due :</u></b></td>
</tr>
<tr>
<td align=left colspan=3><span style='font-family:Arial; font-size:12px; color:#000000;text-indent:40px;'></span></td>
</tr>
<tr>
<th align=left width='80'>S.No</th>
<th align=left width='280'>Vendor Name</th>
<th align=left width='200'>Payment Due Date</th>
</tr>
<tr>
<td align=left colspan=3> </td>
</tr>";
$i=1;
while($result = sqlsrv_fetch_array($query, SQLSRV_FETCH_ASSOC))
{
"<tr>
<td style='border-bottom:1px solid #dfdfdf;padding:10px;' height='25'>". $i ."</td>
<td style='border-bottom:1px solid #dfdfdf;padding:10px;'>". $result['RCE15TITLE']."</td>
<td style='border-bottom:1px solid #dfdfdf;padding:10px;'>". $result['EXE15NXTDDT']."</td>
</tr>";
$i++;}
"</table>
<div style=' float:left; width:541px; height:30px; border-top:3px solid #da251e; background-color:#dfdfdf;border-left:1px solid #c5c5c5; border-right:1px solid #c5c5c5; border-bottom:1px solid #c5c5c5; float:left; line-height:30px; padding-left:15px; font-family:Arial; font-size:10px; color:#828282;'> Copyright ".date('Y')." Circular Edge, Inc. All rights reserved.</div>
</div>";
//echo $result["RCE15TITLE"];
$mail->SetFrom("Sender Email","Text"); // Name is optional
$mail->AddTo("email","Name"); // Name is optional
$mail->Subject = 'Payment Reminder for - '.$today_data;
$mail->Message=$mcontent;
//Optional stuff
//$mail->AddCc("ccaddress@example.com","CC Name"); // Set a CC if needed, name optional
$mail->ContentType = "text/html"; // Defaults to "text/plain; charset=iso-8859-1"
$mail->Headers['X-SomeHeader'] = 'abcde'; // Set some extra headers if required
$mail->ConnectTimeout = 30; // Socket connect timeout (sec)
$mail->ResponseTimeout = 8; // CMD response timeout (sec)
$success = $mail->Send();
if($success)
{
echo "<fieldset>";
echo "<div id='success_page'>";
echo "<h1>Email Sent Successfully.</h1>";
echo "</div>";
echo "</fieldset>";
} else {
echo 'ERROR!';
}
//;
?>