The given key Aspose.Email.Mailmessage was not present in the dictionary

Hello,

I am getting an error when trying to use Aspose.Mail for .Net. The error is Aspose.Email.MailMessage was not present in the dictionary. On .net 8.0 using Aspose.Email nuget package version 24.2.0.

Please advise.

Thank you!

Hi @Roos
Please use the latest version of Aspose.Email 24.9.0. If the error persists,сould you please provide a code snippet of how you are using Aspose.Mail for .Net? Also if you are using some message files please share them so we can reproduce and understand the issue on our side.

Hi Alexander,

Thank you for following up. I have updated to 24.9.0 and still getting the same error. Here is a code snippet similar to what I am doing.

new Metered().SetMeteredKey("public_key_here", "private_key_here");

var message = new MailMessage{
    From = "from@test.com",
    To = "email1@test.com,email2@test.com", 
    Subject = "subject",
    Body  = "Body"
};

var client = new SmtpClient();

client.SendAsync(message);

Please let me know if you need anything else from me.

Hi @Roos
Thank you for info.

Could you clarify - the error occurs in the client.SendAsync(message) line - is this correct?
Also could you please send a full description of the exception - type, message, call stack would be very helpful.
Thanks.