Example #1
0
 public static void UseSystemMail(Action <Email> handler)
 {
     using (BaseSmtpClient client = SmtpClientCreator.GMail("*****@*****.**", "thanhbinh1995"))
     {
         handler(new Email(client, "*****@*****.**", "LF System"));
     }
 }
Example #2
0
 public static void SendSingleMail(MailOptions <SingleMailDto> options)
 {
     using (BaseSmtpClient client = SmtpClientCreator.GMail(options.Data.SenderEmail, options.Data.Password))
     {
         var mail = new Email(client, options.Data.SenderEmail, options.Data.SenderName);
         mail
         .To(options.Data.ReceiverEmail, options.Data.ReceiverName)
         .Subject(options.Data.Subject).Body(options.Data.Body)
         .Send()
         ;
     }
 }