Hi
My application deals with reserving computers. After the computer is reserved a mail is to be send to the user that his computer has been reserved. I did it in the case of one system using string builder class. If multiple computers are reserved how can I send the details of all the computers reserved within the same mail. My code is as follows:
private string BuildReserveNotificationMail(DataRow dr)
{
StringBuilder sb = new StringBuilder();
sb.Append("<html>");
sb.Append("<head>");
sb.Append("<style>");
sb.Append(".GeneralFont{font-family:verdana, Geneva, Arial, Helvetica, sans-serif;FONT-SIZE:12px;FONT-WEIGHT:Normal;Color:#000000;}");
sb.Append(".MaroonFont{font-family:verdana, Geneva, Arial, Helvetica, sans-serif;FONT-SIZE:12px;FONT-WEIGHT:bold;color:Maroon;}");
sb.Append(".NavyFont{font-family:verdana, Geneva, Arial, Helvetica, sans-serif;FONT-SIZE:12px;FONT-WEIGHT:bold;color:Navy;}");
sb.Append("</style>");
sb.Append("</head>");
sb.Append("<body bgcolor='#cfff99'>");
sb.Append("<div class='GeneralFont'>Dear " + dr["Emp_Name"].ToString() + ",<br><br>The Computers You Requested Are Reserved on your name <br><br></div>");
sb.Append("<table width=400>");
sb.Append("<tr><td colspan=3 align=center><font class='MaroonFont'><u>Your Reservation Details</u></font></td></tr>");
sb.Append("<tr><td colspan=3> </td></tr>");
sb.Append("<tr><td class='GeneralFont'>Service Tag</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["Service_Tag_Id"].ToString() + "</td></tr>");
sb.Append("<tr><td class='GeneralFont'>Computer Id</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["Computer_Id"].ToString() + "</td></tr>");
sb.Append("<tr><td class='GeneralFont'>Location</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["Location"].ToString() + "</td></tr>");
sb.Append("<tr><td class='GeneralFont'>Project Belongs To</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["Project_Name"].ToString() + "</td></tr>");
sb.Append("<tr><td class='GeneralFont'>Reserved Date</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["Start_Time"].ToString() + "</td></tr>");
sb.Append("<tr><td class='GeneralFont'>Due Date</td><td class='GeneralFont'>:</td><td class='NavyFont'>" + dr["End_Time"].ToString() + "</td></tr>");
sb.Append("</table>");
sb.Append("<br>");
sb.Append("<div class='GeneralFont'>");
sb.Append("Once you are done with this Computer, Please go to \"MyReservations\" page in IDC Wonderware Lab Reservation System and complete your Reservation by clicking on 'Complete' icon.<br><br><br>");
sb.Append("Thanks and Regards, <br><br>");
sb.Append("<b>IDC Wonderware System Admin</b>");
sb.Append("</div>");
sb.Append("</body>");
sb.Append("</html>");
return sb.ToString();
}
Anyone please help in this issue.
I will be thankful to any solution provided.
Regards
Mahathi.