private void SendReqInfoEmailToAdmin(RequestInfo reqInfo) { strSql = @"SELECT [COUNTRY] FROM [INSTA_PAR_COUNTRY] WHERE [COUNTRY_ID] = " + reqInfo.CountryID; string strCountry = Convert.ToString(objHelper.gExecuteScalar(CommandType.Text, strSql)); StringBuilder htmlString = new StringBuilder(); htmlString.Append(@"<table border='0' cellpadding='0' cellspacing='0' bordercolor='#111111' width='600px' border='5px' bordercolor='#AE4E7C' rules='none' style= '" + strSetDesign + @"'> <tr><td colspan='3' style='height:10px'> </td></tr> <tr> <td colspan='3' style='font-family: Trebuchet MS; font-size: 13px;'> A Product Request Information has been submitted whose details are hereunder: </td> </tr> <tr><td colspan='3' style='height:10px'> </td></tr> <tr> <td style='width:30%; font-family: Trebuchet MS; font-size: 13px;'> Product Name </td> <td style='width:5%; font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='width:65%; font-family: Trebuchet MS; font-size: 13px;'> <b> " + reqInfo.Product.ToUpper() + @"</b> </td> </tr> <tr> <td style='width:30%; font-family: Trebuchet MS; font-size: 13px;'> Company Name </td> <td style='width:5%; font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='width:65%; font-family: Trebuchet MS; font-size: 13px;'> " + reqInfo.Company.ToUpper() + @" </td> </tr> <tr> <td style='width:30%; font-family: Trebuchet MS; font-size: 13px;'> Country </td> <td style='width:5%; font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='width:65%; font-family: Trebuchet MS; font-size: 13px;'> " + strCountry.ToUpper() + @" </td> </tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> Contract Person </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> " + reqInfo.ContactPerson.ToUpper() + @" </td> </tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> Phone </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> " + reqInfo.Phone + @" </td> </tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> Email </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> " + reqInfo.Email.ToLower() + @" </td> </tr> <tr valign='top' > <td style='font-family: Trebuchet MS; font-size: 13px;'> Comment </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> : </td> <td style='font-family: Trebuchet MS; font-size: 13px;'> " + reqInfo.Comment.ToUpper() + @" </td> </tr> <tr><td colspan='3' style='height:10px'> </td></tr> </table>"); //------------------------------------------------------------------------- MailMessage mailmsg = new MailMessage(); mailmsg.From = new MailAddress(reqInfo.ContactPerson.ToUpper() + " <" + reqInfo.Email.ToLower() + ">"); //mailmsg.To.Add(new MailAddress("*****@*****.**")); //mailmsg.To.Add(new MailAddress("*****@*****.**")); // mailmsg.To.Add(new MailAddress("*****@*****.**")); mailmsg.Bcc.Add(new MailAddress("*****@*****.**")); //------------------------------------------------------------------------- mailmsg.Subject = "Request For Product Information : " + reqInfo.Product; mailmsg.Body = htmlString.ToString(); mailmsg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.Send(mailmsg); //------------------------------------------------------------------------- }
private void SendReqInfoEmailToSubmitter(RequestInfo ReqIn) { StringBuilder htmlString = new StringBuilder(); htmlString.Append(@"<table border='0' cellpadding='0' cellspacing='0' bordercolor='#111111' width='600px' border='5px' bordercolor='#AE4E7C' rules='none' style='" + strSetDesign + @"'> <tr><td style='height:10px'> </td></tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> Thank you! </td> </tr> <tr><td style='height:10px'> </td></tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> We have received your request for product information. <br /> We will get back to you within 7 working days. </td> </tr> <tr><td style='height:10px'> </td></tr> <tr><td style='height:10px'> </td></tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> Best Regards, </td> </tr> <tr> <td style='font-family: Trebuchet MS; font-size: 13px;'> INSTA EXHIBITIONS PVT LTD </td> </tr> <tr><td style='height:10px'> </td></tr> </table>"); //------------------------------------------------------------------------- MailMessage mailmsg = new MailMessage(); mailmsg.From = new MailAddress("INSTA-GROUP <*****@*****.**>"); mailmsg.To.Add(new MailAddress(ReqIn.Email)); mailmsg.Subject = "Thank you for Product information request : " + ReqIn.Product; mailmsg.Body = htmlString.ToString(); mailmsg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.Send(mailmsg); //------------------------------------------------------------------------- }
public bool RequestInformation(RequestInfo reqInfo) { try { if (string.IsNullOrWhiteSpace(reqInfo.Email)) return false; strSql = @"INSERT INTO [INSTA_MST_REQUEST_INFORMATION] ([COMPANY_NAME] ,[COUNTRY_ID] ,[CONTACT_PERSON] ,[PHONE] ,[EMAIL] ,[COMMENT] ,[SAVE_DATE]) VALUES ('" + objGen.gReplaceQuotes(reqInfo.Company.ToUpper()) + @"' ," + reqInfo.CountryID + @" ,'" + objGen.gReplaceQuotes(reqInfo.ContactPerson.ToUpper()) + @"' ,'" + objGen.gReplaceQuotes(reqInfo.Phone) + @"' ,'" + objGen.gReplaceQuotes(reqInfo.Email.ToLower()) + @"' ,'" + objGen.gReplaceQuotes(reqInfo.Comment.ToUpper()) + @"' ,GETDATE())"; if (objHelper.gExecuteNonQuery(CommandType.Text, strSql) > 0) { SendReqInfoEmailToSubmitter(reqInfo); SendReqInfoEmailToAdmin(reqInfo); } } catch { } return true; }