Beispiel #1
0
    private void SendBuyer_ConfirmationMail(string sellerName, string mailTo, DataTable dtOrderedItems, string strUrlContactSeller)
    {
        string mailMessage = string.Empty;
        string mailFrom    = "*****@*****.**";
        string MailBody    = "Thank you for your order at ApnerDeal.com. This is an acknowledegement of your order. Please email to [email protected] for further query.";

        string mailSubject = "Order from ApnerDeal.com";

        //string mailSubject = "Your ApnerDeal order no." + dtOrderedItems.Rows[0]["OrderID"].ToString();

        mailMessage  = UTLUtilities.MailLogoHeader();
        mailMessage += "<div style=\"color:#000000; line-height:18px\">Dear <strong>Mr./Ms. " + sellerName + "</strong>,<br/>";
        mailMessage += "<br/>";
        mailMessage += Server.HtmlEncode(MailBody);
        mailMessage += "<br/><br/>";

        mailMessage += "</br></br>Please Click on the link for Detail:";
        mailMessage += "</br><a href=\"" + strUrlContactSeller + "\" target=\"blank\">" + strUrlContactSeller + "</a>";
        //  mailMessage += "<strong>Profile ID: " + dtOrderedItems.Rows[0]["ProfileID"].ToString() + "</strong>";
        // mailMessage += "<br/><strong>Product Name: " + dtOrderedItems.Rows[0]["ProductTitle"].ToString() + "</strong>";
        mailMessage += "<br/><br/>";



        mailMessage += GetOrderDetail_Header();

        if (dtOrderedItems.Rows.Count > 0)
        {
            mailMessage += "<table id=\"OrderList\" style=\"width:100%; color:#000000; border:0px solid #EFEFE2\"";
            mailMessage += "cellspacing=\"0px\"  cellpadding=\"0px\">";
            for (int index = 0; index < dtOrderedItems.Rows.Count; index++)
            {
                string strBackgroundColor = "";
                if (index % 2 == 1)
                {
                    strBackgroundColor = "#F5F5F7";
                }
                else
                {
                    strBackgroundColor = "white";
                }
                mailMessage += "<tr style=\"vertical-align:top; background-color:" + strBackgroundColor + "\">";
                mailMessage += "<td  style=\"width:150px;padding:5px\">" + dtOrderedItems.Rows[index]["ProductTitle"].ToString() + "</td>";
                //mailMessage += "<td  style=\"width:80px;\">" + dtOrderedItems.Rows[index]["Quantity"].ToString() + "</td>";
                if (CategoryID == "9")
                {
                    mailMessage += "<td align=\"right\" style=\"width:80px;\">&nbsp;</td>";
                }
                else
                {
                    mailMessage += "<td  style=\"width:110px;\">" + dtOrderedItems.Rows[index]["SalePrice"].ToString() + "</td>";
                }
                //mailMessage += "</div><div><strong>Charge:<br/> </strong>" + dtOrderedItems.Rows[index]["CodCost"].ToString() + "</td>";
                // mailMessage += "<td  style=\"width:80px;padding:5px\">" + dtOrderedItems.Rows[index]["CodCost"].ToString() + "</td>";
                // mailMessage += "<td  style=\"width:90px;padding:5px\">" + dtOrderedItems.Rows[index]["Subtotal"].ToString() + "</td>";
                // mailMessage += "<td  style=\"width:90px;\">" + dtOrderedItems.Rows[index]["PaymentOption"].ToString() + "</td>";

                mailMessage += "<td class=\"columnheader\" style=\"font-weight:normal;padding:5px; line-height:17px;\">";
                //mailMessage += "<strong>Company Name: </strong>" + dtOrderedItems.Rows[index]["SellerInfo"].ToString() + "<br/>";
                // mailMessage += "<strong>Billing Person: </strong>" + dtOrderedItems.Rows[index]["Seller_BillingPerson"].ToString() + "<br /> ";
                mailMessage += "<strong>Seller Cell No: </strong>" + dtOrderedItems.Rows[index]["Mobile"].ToString() + "<br/>";
                mailMessage += "<strong>Seller Address: </strong>" + dtOrderedItems.Rows[index]["ContactAddress"].ToString() + "<br />";
                mailMessage += "<strong>LoginEmail: </strong>" + dtOrderedItems.Rows[index]["LoginEmail"].ToString() + "<br />";
                // mailMessage += "<strong>Website Url: </strong>" + dtOrderedItems.Rows[index]["Seller_URL"].ToString() + "<br />";
            }
            mailMessage += "</td></tr>";
            mailMessage += "<tr><td colspan=\"6\" style=\"text-align:center;line-height:25px\">";
            mailMessage += "<span style=\"color:#990000;font-weight:bold;font-family:verdana;\">";
            //mailMessage += "Total Amount: " + dtOrderedItems.Rows[0]["Currency"].ToString() + " " + dtOrderedItems.Rows[0]["SubTotal"].ToString() + "</span>";
            mailMessage += "</td></tr>";
            mailMessage += "</table></div>";
            mailMessage += "<div align=\"center\" style=\"color:red; margin-top:15px; text-align:left; font-weight:bold\">This is an auto generated mail. Please do not reply.</div>";
        }
        mailMessage += "</td></tr></table>";
        MailMaster.SendMail(mailTo, mailFrom, mailSubject, mailMessage);
    }