You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download the SendGrid NuGet Package and the SendGridEmail NuGet Package
Install-Package Serilog.Sinks.SendGridEmail
Create an Instance of the SendGridClient (SendGrid namespace)
varclient=newSendGridClient("Your Send Grid API Key");
Create an EmailConnectionInfo (Serilog.Sinks.Email namespace)
varemailConnectionInfo=newEmailConnectionInfo{EmailSubject="Application Error",FromEmail="Your From Email",ToEmail="Your To Email",SendGridClient=client,FromName="Your Friendly From Name"};
Create your own customized Serilog logger, and then include the .WriteTo.Email extension, just like with the Serilog.Sinks.Email NuGet package.