使用 c# 客户端发送的电子邮件但未收到?

时间:2021-01-28 20:21:32

标签: c# email smtp smtpclient

我正在使用电子邮件客户端做一些事情。我正在使用 MailKit,我可以看到发送的消息,但我没有在指定的电子邮件地址上收到它们。作为一个简单的测试,我做了这个控制台应用程序:

public static void Main()
{
    SmtpClient client = new SmtpClient("smtp.office365.com", 587);
    client.EnableSsl = true;
    client.UseDefaultCredentials = false;
    client.Credentials = new System.Net.NetworkCredential("****", "@ffice.0123");
    client.DeliveryMethod = SmtpDeliveryMethod.Network;
    client.Send("****", "xxxx", "test", "test");

    Console.WriteLine("sent!");
    Console.ReadLine();
}

消息“已发送!”正在显示,没有例外。在 Outlook 中,电子邮件显示为已发送:

https://laravel.com/docs/8.x/eloquent-relationships#one-to-many

但是在接收者的电子邮件中没有收到任何内容。不在收件箱中,不在垃圾邮件中。不在 gmail 上,不在 yahoo 邮件上。这里可能有什么问题?

0 个答案:

没有答案