Dear team,
I tried send mail from updatable dashboard and Order details, Po details, etc… html table design structure but, the html table design structure not working.
The below mail code for i tried,
if(toMail !="" && frmEmail!="")
{
toMail = "testmail@gmail.com";
subject="Reg Ready in Days: " + tmpDays;
Emailbody="Dear "+ custName + ", \n";
Emailbody= Emailbody + "\n\n The following order is ready to dispatch in " + tmpDays + " days.";
bodyStr = "<html><body><pre style='font: monospace'>";
bodyStr = bodyStr + "<style>table, th, td {border: 1px solid black;font-family: monospace; font-size: 12px;}";
bodyStr = bodyStr + "th, td {padding: 5px;text-align: left;}</style>";
bodyStr = bodyStr + "<table><tbody> <tr><th>Order Number </th> <th> Po Number</th> <th> Part Number</th> <th> Description</th> <th> Qty </th> <th> Actual Delivery Date </th> </tr> <tr><td>"+tmpOrderNo+"</td><td>"+tmpPoNo+"</td><td>"+tmpPartNo+"</td><td>"+tmpDesc+"</td><td>"+tmpQty+"</td><td>"+tmpActDate+"</td> </tr></tbody></table>";
bodyStr = bodyStr + "</pre></body></html>";
//Emailbody = Emailbody + "<style>table, th, td {border: 1px solid black;border-collapse: collapse; font-family: monospace; font-size: 12px;}";
//Emailbody = Emailbody + "\n\n\n <html><body><pre style='font: monospace'><table style='font-size:15px;font-family:Cambria;' border='1'><tbody> <tr><th>Order Number </th> <th> Po Number</th> <th> Part Number</th> <th> Description</th> <th> Qty </th> <th> Actual Delivery Date </th> </tr> <tr><td>"+tmpOrderNo+"</td><td>"+tmpPoNo+"</td><td>"+tmpPartNo+"</td><td>"+tmpDesc+"</td><td>"+tmpQty+"</td><td>"+tmpActDate+"</td> </tr></tbody> </table></body></html>";
//Emailbody = Emailbody + "<html><body><table style='font-size:15px;font-family:Cambria;' border='1'><tbody> <tr> First </tr> <tr> Second </tr><tr> <td> 1 </td> <td> 2 </td> </tr></tbody></table></body></html>";
Emailbody = Emailbody + "\n\n" + bodyStr + "\n\n\n\n\n\n\n Regards, \n\n Epicor Email Notification";
var mailer = this.GetMailer(async: false);
var message = new Ice.Mail.SmtpMail();
message.SetFrom(frmEmail);
message.SetTo(toMail);
//message.SetCC(cc);
message.IsBodyHtml = true;
message.SetSubject(subject);
message.SetBody(Emailbody);
mailer.Send(message);
}