{"action":"created","issue":{"url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/4","labels_url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/4/comments","events_url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/4/events","html_url":"https://github.com/serilog/serilog-sinks-email/pull/4","id":98232718,"number":4,"title":"Configuration Overload for Using system.net.mailSettings","user":{"login":"mattgwagner","id":157644,"avatar_url":"https://avatars.githubusercontent.com/u/157644?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgwagner","html_url":"https://github.com/mattgwagner","followers_url":"https://api.github.com/users/mattgwagner/followers","following_url":"https://api.github.com/users/mattgwagner/following{/other_user}","gists_url":"https://api.github.com/users/mattgwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgwagner/subscriptions","organizations_url":"https://api.github.com/users/mattgwagner/orgs","repos_url":"https://api.github.com/users/mattgwagner/repos","events_url":"https://api.github.com/users/mattgwagner/events{/privacy}","received_events_url":"https://api.github.com/users/mattgwagner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-30T18:33:21Z","updated_at":"2015-07-30T18:48:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/serilog/serilog-sinks-email/pulls/4","html_url":"https://github.com/serilog/serilog-sinks-email/pull/4","diff_url":"https://github.com/serilog/serilog-sinks-email/pull/4.diff","patch_url":"https://github.com/serilog/serilog-sinks-email/pull/4.patch"},"body":"As it exists currently, if you want to use the appSettings to configure the email sink, you need to provide the following keys to get it to work. \r\n\r\n```\r\n    <add key=\"serilog:using\" value=\"Serilog.Sinks.Email\" />\r\n    <add key=\"serilog:write-to:Email.toEmail\" value=\"Errors@Whatever.com\" />\r\n    <add key=\"serilog:write-to:Email.fromEmail\" value=\"Errors@Whatever.com\" />\r\n    <add key=\"serilog:write-to:Email.mailServer\" value=\"localhost\" />\r\n```\r\nInterestingly, if you leave the mailServer key blank (\"\"), it will use one in system.net.mailSettings from your config file. This change makes it so that you only need to provide toEmail and fromEmail, since our typical config behavior is to provide these keys in every app that needs to send email:\r\n\r\n```\r\n  <system.net>\r\n    <mailSettings>\r\n      <smtp deliveryMethod=\"Network\" from=\"NoReply@Whatever.com\">\r\n        <network host=\"localhost\" port=\"25\" />\r\n      </smtp>\r\n    </mailSettings>\r\n  </system.net>\r\n```"},"comment":{"url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/comments/126433274","html_url":"https://github.com/serilog/serilog-sinks-email/pull/4#issuecomment-126433274","issue_url":"https://api.github.com/repos/serilog/serilog-sinks-email/issues/4","id":126433274,"user":{"login":"mattgwagner","id":157644,"avatar_url":"https://avatars.githubusercontent.com/u/157644?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgwagner","html_url":"https://github.com/mattgwagner","followers_url":"https://api.github.com/users/mattgwagner/followers","following_url":"https://api.github.com/users/mattgwagner/following{/other_user}","gists_url":"https://api.github.com/users/mattgwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgwagner/subscriptions","organizations_url":"https://api.github.com/users/mattgwagner/orgs","repos_url":"https://api.github.com/users/mattgwagner/repos","events_url":"https://api.github.com/users/mattgwagner/events{/privacy}","received_events_url":"https://api.github.com/users/mattgwagner/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T18:48:36Z","updated_at":"2015-07-30T18:48:36Z","body":"Also, not sure if it was my particular test harness, but I had to add the following binding redirects to get this to work:\r\n\r\n```\r\n  <runtime>\r\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n      <dependentAssembly>\r\n        <assemblyIdentity name=\"Serilog\" publicKeyToken=\"24c2f752a8e58a10\" culture=\"neutral\" />\r\n        <bindingRedirect oldVersion=\"0.0.0.0-1.5.0.0\" newVersion=\"1.5.0.0\" />\r\n      </dependentAssembly>\r\n      <dependentAssembly>\r\n        <assemblyIdentity name=\"Serilog.FullNetFx\" publicKeyToken=\"24c2f752a8e58a10\" culture=\"neutral\" />\r\n        <bindingRedirect oldVersion=\"0.0.0.0-1.5.0.0\" newVersion=\"1.5.0.0\" />\r\n      </dependentAssembly>\r\n    </assemblyBinding>\r\n  </runtime>\r\n``` "}}