Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use appsetting to configure credentials for email send #76

Open
pcharb opened this issue Dec 6, 2019 · 4 comments
Open

Unable to use appsetting to configure credentials for email send #76

pcharb opened this issue Dec 6, 2019 · 4 comments

Comments

@pcharb
Copy link

pcharb commented Dec 6, 2019

When I try to use serilogs appconfig to set up my sinks email, the network credentials are not being used

Here is my config

<add key="serverUrl" value="localhost"/>
<add key="serilog:using:Email" value="Serilog.Sinks.Email" />
<add key="serilog:write-to:Email.fromEmail" value="emailfrom"/>
<add key="serilog:write-to:Email.toEmail" value="emailto" />
<add key="serilog:write-to:Email.mailServer" value="in-v3.mailjet.com" />

<add key="serilog:enrich:with-property:environment" value="Localhost" />
<add key="serilog:write-to:Email.port" value="587"/>
<add key="serilog:write-to:Email.networkCredentials" value="'username':'username' 'password':'password'"/>

<add key="serilog:write-to:Email.EnableSsl" value="true"/>
<add key="serilog:write-to:Email.mailSubject" value="[{environment} - {MachineName}]" />
<add key="serilog:write-to:Email.outputTemplate" value="{Timestamp:yyyy-MM-dd  HH:mm:ss}:: [{SourceContext} {NewLine}{Level:u3} - {Message:lj}{NewLine}{Exception}{SourceContext}]" />
<add key="serilog:write-to:Email.restrictedToMinimumLevel" value="Error" />

I'm unable to find any documentation on what i,m doing wrong. The issue might be more of a documentation issue.

@pcharb pcharb changed the title Unable to use appsetting to configure credentials for amail send Unable to use appsetting to configure credentials for email send Dec 6, 2019
@brunis
Copy link

brunis commented Jun 17, 2020

I have the same problem, no docs or explanation for how to configure this sink through AppSettings.
I tried using

<add key="serilog:write-to:Email.networkCredentials.UserName" value="username"/>
<add key="serilog:write-to:Email.networkCredentials.Password" value="password"/>

Also, no luck.
@pcharb did you manage to solve it?

@KrzysztofPajak
Copy link

Any news?
It would be great if this problem will be resolved?

@brunis
Copy link

brunis commented Jul 9, 2020

Any news?
It would be great if this problem will be resolved?

We ended up using our own configuration entries to set it up. Seems it's only configurable through appsettings.json for now..

@FransdeJong
Copy link

@brunis are you using this in core or framework? I'm using Umbraco and .Net Framework so I don't have a appsettings.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants