lukencode / FluentEmail

All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
https://lukelowrey.com/dotnet-email-guide-2021/
MIT License
3.02k stars 434 forks source link

Method not found: 'Void MailKit.MailTransport.Send(MimeKit.MimeMessage, System.Threading.CancellationToken, MailKit.ITransferProgress)'. #326

Open neozhu opened 2 years ago

neozhu commented 2 years ago

services.AddFluentEmail(mailSettings.From) .AddRazorRenderer() // this configuration is working .AddSmtpSender(new System.Net.Mail.SmtpClient() { Host = mailSettings.Host, Port = mailSettings.Port, EnableSsl = mailSettings.UseSsl, Credentials = new System.Net.NetworkCredential(mailSettings.UserName, mailSettings.Password) }); // this configuration with Mailkit not working. //.AddMailKitSender(new FluentEmail.MailKitSmtp.SmtpClientOptions() //{ // RequiresAuthentication = !string.IsNullOrEmpty(mailSettings.UserName), // UsePickupDirectory = false, // Password = mailSettings.Password, // Port = mailSettings.Port, // Server = mailSettings.Host, // User = mailSettings.UserName, // UseSsl = mailSettings.UseSsl, //});

Method not found: 'Void MailKit.MailTransport.Send(MimeKit.MimeMessage, System.Threading.CancellationToken, MailKit.ITransferProgress)'. why?

ghost commented 2 years ago

Yes. I have exact same issue. I'm very surprised that the author @lukencode has not responded at all since April. I guess it's time not to use this nugget packages

tigrin commented 1 year ago

For me, this issue happens when I have MailKit version 3.0.0 or greater installed.

It looks like MailKit 3.0.0 changed the signature to return a string instead of a void. Link to commit

AdisonCavani commented 1 year ago

This is a duplicate of #296 You can close the issue and move this conversation to issue above.