Пример #1
0
 private void SendIntromail(string Agentname, string Username)
 {
     try
     {
         clsMailFormats format = new clsMailFormats();
         MailMessage    msg    = new MailMessage();
         msg.From = new MailAddress("*****@*****.**");
         msg.To.Add(Username);
         //msg.Subject = "Thank You For Your Interest In United Car Exchange";
         msg.IsBodyHtml = true;
         string text     = string.Empty;
         string Language = string.Empty;
         if (ddlUserType.SelectedItem.Value == "2")
         {
             Language    = "Eng(D)";
             msg.Subject = "Thank You For Your Interest In United Car Exchange";
             text        = format.SendIntromaildetailsForDealers(Agentname, ref text);
             msg.Attachments.Add(new Attachment(Server.MapPath("~/MailTemplate/United Car Exchange -  Dealership Compass Brochure v2.pdf")));
             msg.From = new MailAddress("*****@*****.**");
         }
         else
         {
             if (Convert.ToInt32(ddlLanguage.SelectedItem.Value) == 2)
             {
                 Language    = "Esp";
                 msg.Subject = "Gracias por su interés en United Car Exchange";
                 text        = format.SendSpanishIntromaildetails(Agentname, ref text);
             }
             else
             {
                 Language    = "Eng";
                 msg.Subject = "Thank You For Your Interest In United Car Exchange";
                 text        = format.SendIntromaildetails(Agentname, ref text);
             }
         }
         msg.Body = text.ToString();
         SmtpClient smtp = new SmtpClient();
         //smtp.Host = "smtp.gmail.com";
         //smtp.Port = 587;
         //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad");
         //smtp.EnableSsl = true;
         //smtp.Send(msg);
         smtp.Host = "127.0.0.1";
         smtp.Port = 25;
         smtp.Send(msg);
         bool bnew = objHotLeadBL.USP_SaveIntroMailDetails(Agentname, Username, Session[Constants.USER_ID].ToString(), Language);
     }
     catch (Exception ex)
     {
         //throw ex;
         Response.Redirect("EmailServerError.aspx");
     }
 }
Пример #2
0
 private void SendIntromail(string Agentname, string Username)
 {
     try
     {
         clsMailFormats format = new clsMailFormats();
         MailMessage msg = new MailMessage();
         msg.From = new MailAddress("*****@*****.**");
         msg.To.Add(Username);
         //msg.Subject = "Thank You For Your Interest In United Car Exchange";
         msg.IsBodyHtml = true;
         string text = string.Empty;
         string Language = string.Empty;
         if (ddlUserType.SelectedItem.Value == "2")
         {
             Language = "Eng(D)";
             msg.Subject = "Thank You For Your Interest In United Car Exchange";
             text = format.SendIntromaildetailsForDealers(Agentname, ref text);
             msg.Attachments.Add(new Attachment(Server.MapPath("~/MailTemplate/United Car Exchange -  Dealership Compass Brochure v2.pdf")));
             msg.From = new MailAddress("*****@*****.**");
         }
         else
         {
             if (Convert.ToInt32(ddlLanguage.SelectedItem.Value) == 2)
             {
                 Language = "Esp";
                 msg.Subject = "Gracias por su interés en United Car Exchange";
                 text = format.SendSpanishIntromaildetails(Agentname, ref text);
             }
             else
             {
                 Language = "Eng";
                 msg.Subject = "Thank You For Your Interest In United Car Exchange";
                 text = format.SendIntromaildetails(Agentname, ref text);
             }
         }
         msg.Body = text.ToString();
         SmtpClient smtp = new SmtpClient();
         //smtp.Host = "smtp.gmail.com";
         //smtp.Port = 587;
         //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad");
         //smtp.EnableSsl = true;
         //smtp.Send(msg);
         smtp.Host = "127.0.0.1";
         smtp.Port = 25;
         smtp.Send(msg);
         bool bnew = objHotLeadBL.USP_SaveIntroMailDetails(Agentname, Username, Session[Constants.USER_ID].ToString(), Language);
     }
     catch (Exception ex)
     {
         //throw ex;
         Response.Redirect("EmailServerError.aspx");
     }
 }
Пример #3
0
 private void SendIntromail1(string Agentname, string Username)
 {
     try
     {
         clsMailFormats format = new clsMailFormats();
         MailMessage msg = new MailMessage();
         msg.From = new MailAddress("*****@*****.**");
         msg.To.Add(Username);
         //msg.Subject = "Thank You For Your Interest In United Car Exchange";
         msg.IsBodyHtml = true;
         string text = string.Empty;
         string Language = string.Empty;
         if (ddlUserType.SelectedItem.Value == "2")
         {
             Language = "Eng(D)";
             msg.Subject = "Thank You For Your Interest In United Car Exchange";
             text = format.SendIntromaildetailsForDealers(Agentname, ref text);
             msg.Attachments.Add(new Attachment(Server.MapPath("~/MailTemplate/United Car Exchange -  Dealership Compass Brochure v2.pdf")));
             msg.From = new MailAddress("*****@*****.**");
         }
         else
         {
             if (Convert.ToInt32(ddlLanguage.SelectedItem.Value) == 2)
             {
                 Language = "Esp";
                 msg.Subject = "Gracias por su interés en United Car Exchange";
                 text = format.SendSpanishIntromaildetails(Agentname, ref text);
             }
             else
             {
                 Language = "Eng";
                 msg.Subject = "Thank You For Your Interest In United Car Exchange";
                 text = format.SendIntromaildetails(Agentname, ref text, ddlBrand.SelectedValue);
             }
         }
         msg.Body = text.ToString();
         Session["PreviewMail"] = text.ToString();
     }
     catch { }
 }