Mailkit: some of the SmtpClient function's don't exist?

Created on 11 Jan 2019  路  2Comments  路  Source: jstedfast/MailKit

Describe the bug
Tried the send email message example on the readme. VS.Net 2017 is telling me some of the SmtpClient function's don't exist.

Severity Code Description Project File Line Suppression State
Error CS1061 'SmtpClient' does not contain a definition for 'ServerCertificateValidationCallback' and no accessible extension method 'ServerCertificateValidationCallback' accepting a first argument of type 'SmtpClient' could be found (are you missing a using directive or an assembly reference?) Classes\email.cs 98 Active

Severity Code Description Project File Line Suppression State
Error CS1061 'SmtpClient' does not contain a definition for 'Connect' and no accessible extension method 'Connect' accepting a first argument of type 'SmtpClient' could be found (are you missing a using directive or an assembly reference?) Classes\email.cs 100 Active

Severity Code Description Project File Line Suppression State
Error CS1061 'SmtpClient' does not contain a definition for 'Authenticate' and no accessible extension method 'Authenticate' accepting a first argument of type 'SmtpClient' could be found (are you missing a using directive or an assembly reference?) Classes\email.cs 103 Active

Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'MimeKit.MimeMessage' to 'System.Net.Mail.MailMessage' Classes\email.cs 105 Active

Severity Code Description Project File Line Suppression State
Error CS1061 'SmtpClient' does not contain a definition for 'Disconnect' and no accessible extension method 'Disconnect' accepting a first argument of type 'SmtpClient' could be found (are you missing a using directive or an assembly reference?) Classes\email.cs 106 Active

Screenshots
https://i.postimg.cc/FRg7bqjB/Capture.png

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Browser ?
  • Version 2.1.2
question

Most helpful comment

I bet you have a using System.Net.Mail; at the top of your file. That'll cause your code to create a System.Net.Mail.SmtpClient which, of course, does not have the MailKit.Net.Smtp.SmtpClient methods :p

All 2 comments

I bet you have a using System.Net.Mail; at the top of your file. That'll cause your code to create a System.Net.Mail.SmtpClient which, of course, does not have the MailKit.Net.Smtp.SmtpClient methods :p

I bet you have a using System.Net.Mail; at the top of your file. That'll cause your code to create a System.Net.Mail.SmtpClient which, of course, does not have the MailKit.Net.Smtp.SmtpClient methods :p

I was! 馃挴

Was this page helpful?
0 / 5 - 0 ratings