它说here自动检测到用户名和主机名。在sql中检测到主机名,但“用户”列为空。我想念什么?
EmailOptions emailOptions = new EmailOptions
{
MailRecipient = Configuration["ErrorMailRecipient"],
MailSender = "xx@xxx.com",
SmtpServer = "smtp.sendgrid.net",
AuthUserName = "xxxx",
AuthPassword = "xxxx"
};
services.AddElmah<SqlErrorLog>(options =>
{
options.ConnectionString = Configuration["Data:ElmahConnection"];
options.ApplicationName = Configuration["Data:ApplicationName"];
options.Notifiers.Add(new ErrorMailNotifier("Email", emailOptions));
});