Open Abdelrahmandev1984 opened 2 years ago
As the sender has limited emails per day or per hour, I need to select the proper sender according to the number of receivers, I am using Mailkit sender and trying to do something like that but still send from the default sender configured in DI
fluentEmail.Sender = GetFluentEmailSender(fluentEmail.Sender, fluentEmail.Data.ToAddresses.Count);
The DI configuration:
services.AddFluentEmail(defaultFromEmail, defaultFromName). AddRazorRenderer(templateRootFolder); services.AddSingleton<ISender>(new MailKitSender( new SmtpClientOptions { Server = notificationSettings.EmailSettings.MailKitSender.Server, Port = notificationSettings.EmailSettings.MailKitSender.Port, Password = password, UseSsl = notificationSettings.EmailSettings.MailKitSender.UseSsl, User = notificationSettings.EmailSettings.MailKitSender.UserName, SocketOptions = (MailKit.Security.SecureSocketOptions)notificationSettings.EmailSettings.MailKitSender.SocketOptions, RequiresAuthentication = notificationSettings.EmailSettings.MailKitSender.RequiresAuthentication } ));
Is this a bug or am I misusing it?
As the sender has limited emails per day or per hour, I need to select the proper sender according to the number of receivers, I am using Mailkit sender and trying to do something like that but still send from the default sender configured in DI
fluentEmail.Sender = GetFluentEmailSender(fluentEmail.Sender, fluentEmail.Data.ToAddresses.Count);
The DI configuration:
Is this a bug or am I misusing it?