0

私のプログラムは、debian 10 Linux サーバーで実行されます。

C# プログラムで EASendMail というパッケージを使用しましたが、通常の System.Net.Mail でも機能しません。

これは、メールの送信に使用するコード スニペットです。

SmtpMail oMail = new SmtpMail("mykey");

                oMail.From = fromEmail;
                oMail.To = toEmail;

                oMail.Subject = "Subject";
                oMail.TextBody = "Body";

                SmtpServer oServer = new SmtpServer(exchange);
                oServer.User = email;
                oServer.Password = pass;
                oServer.Port = 25;
                

                Console.WriteLine("start to send email ...");

                SmtpClient oSmtp = new SmtpClient();
                oSmtp.SendMail(oServer, oMail); 

                Console.WriteLine("email was sent successfully!");

Linuxでプログラムを開始するたびに、プログラムdotnet run全体が完全に実行されます。smtp 部分を実行すると、次のエラーが表示されます。Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libkernel32.dll: cannot open shared object file: No such file or directory

kernel32.dll が Windows 専用であることは理解していますが、これに対する修正はありますか?

前もって感謝します!!

4

0 に答える 0