Skip to content

Exception Emails are not sent in asp.net core 3.1 razor pages #183

Open
@fingers10

Description

@fingers10

I'm configuring exceptional email options in my asp.net core 3.1 app. But doesn't seem to work.

here is my start up,

services.AddExceptional(settings =>
{
    settings.Store.ApplicationName = "Exceptional.Web";
    settings.Store.Type = "SQL";
    settings.Store.ConnectionString = "Server=(localdb)\\mssqllocaldb;Database=ExceptionalDemos;Trusted_Connection=True;MultipleActiveResultSets=true";
    settings.UseExceptionalPageOnThrow = false;
    settings.Email.ToAddress = "[email protected]";
    settings.Email.FromAddress = "[email protected]";
    settings.Email.FromDisplayName = "[email protected]";
    settings.Email.SMTPHost = "xxxx.xxxx.net";
    settings.Email.SMTPPort = 0000;
    settings.Email.SMTPUserName = "[email protected]";
    settings.Email.SMTPPassword = "xxxx";
    settings.Email.SMTPEnableSSL = true;
});

I'm using the same to send email in my app and it works,

using (var smtp = new SmtpClient("xxxx.xxxx.net", 0000))
{
    smtp.UseDefaultCredentials = false;
    smtp.EnableSsl = true;
    NetworkCredential credentials = new NetworkCredential("[email protected]", "xxxx");
    smtp.Credentials = credentials;
    var msg = new MailMessage
    {
        Body = "Error From App",
        Subject = "Error Test",
        From = new MailAddress("[email protected]")
    };
    msg.To.Add("[email protected]");
    await smtp.SendMailAsync(msg);
}

I not able to find out any error messages logged in console. Any ideas on why the exception emails are not getting sent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions