public void SendIntroMail(int companyId, string subject, string body, string email) { var header = new Attachment(HttpContext.Current.Server.MapPath("/img/bg-email.jpg")); header.ContentId = "header"; header.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; header.ContentDisposition.Inline = true; var banner = new Attachment(HttpContext.Current.Server.MapPath("/img/logo.png")); banner.ContentId = "banner"; banner.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; banner.ContentDisposition.Inline = true; //attachment.ContentType = "image/jpg"; //attachment.ContentDisposition = "inline"; //{ // Content = Convert.ToBase64String(System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath("/img/logo.png"))), // Filename = "banner", // Disposition = "inline", // Type = "image/jpg", //}; var logo = new Attachment(HttpContext.Current.Server.MapPath("/img/dbo.png")); logo.ContentId = "logo"; logo.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; logo.ContentDisposition.Inline = true; //{ // Content = Convert.ToBase64String(System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath("/img/dbo.png"))), // ContentId = "logo", // Filename = "logo", // Disposition = "inline", // Type = "image/png", //}; var registrationRepository = new RegistrationRepository(); body = body.Replace("http://discoverbusinessopportunities.com", "http://discoverbusinessopportunities.com/home/register?token=" + registrationRepository.GetRegistrationCode(companyId)); var service = new GoogleEmailService( email, subject, email, body, true, true, header, banner, logo ); service.SendMail(); }
public void SendIntroMail(int companyId, string subject, string body, string email) { var header = new Attachment { Content = Convert.ToBase64String(System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath("/img/bg-email.jpg"))), ContentId = "header", Filename = "header", Disposition = "inline", Type = "image/jpg", }; var banner = new Attachment { Content = Convert.ToBase64String(System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath("/img/logo.png"))), ContentId = "banner", Filename = "banner", Disposition = "inline", Type = "image/png", }; var logo = new Attachment { Content = Convert.ToBase64String(System.IO.File.ReadAllBytes(HttpContext.Current.Server.MapPath("/img/dbo.png"))), ContentId = "logo", Filename = "logo", Disposition = "inline", Type = "image/png", }; var registrationRepository = new RegistrationRepository(); body = body.Replace("http://discoverbusinessopportunities.com", "http://discoverbusinessopportunities.com/home/register?token=" + registrationRepository.GetRegistrationCode(companyId)); var service = new SendGridEmailService( email, subject, email, body, true, true, banner, logo ); service.Send(); }