serilog / serilog-sinks-email

A Serilog sink that writes events to SMTP email
Apache License 2.0
70 stars 68 forks source link

How to send email to multiple recipients? #119

Open raysefo opened 1 year ago

raysefo commented 1 year ago

Hi, I tried this way but no emails were sent, is there a way to send it to multiple recipients?

{
        "Name": "CustomEmail",
        "Args": {
          "ConnectionInfo": {
            "NetworkCredentials": {

              "UserName": "support@support.com",
              "Password": "1234"
            },
            "FromEmail": "support@support.com",
            "MailServer": "smtp.gmail.com",
            "EmailSubject": "[{Level}] Multiple Requests",
            "Port": "465",
            "IsBodyHtml": false,
            "EnableSsl": true,
            "ToEmail": "to1@gmail.com; to2@gmail.com",
            "RestrictedToMinimumLevel": "Error",
            "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm} [{Level}] {Message}{NewLine}{Exception}"
          }

        }
      }
raysefo commented 1 year ago

Those configurations below did not help either. (Using 2.4 version)

`"ToEmail": "to1@gmail.com; to2@gmail.com"

"ToEmail": "to1@gmail.com, to2@gmail.com"`

nblumhardt commented 6 months ago

I think you may need to remove the spaces after the commas/semicolons. This looks like a bug, would be great to confirm.