Skip to content

Cant' send mails, because recipients seems to be empty. #17

@Robar666

Description

@Robar666

I tried to send an example email, code from https://developers.sparkpost.com/

var transmission = new Transmission();
transmission.Content.From.Email = "testing@sparkpostbox.com";
transmission.Content.Subject = "Oh hey!";
transmission.Content.Text = "Testing SparkPost - the world\'s most awesomest email service!";
transmission.Content.Html = "<html><body><p>Testing SparkPost - the world\'s most awesomest email service!</p></body></html>";

var recipient = new Recipient
{
    Address = new Address { Email = "developers+csharp@sparkpost.com" }
};
transmission.Recipients.Add(recipient);

var sparky = new Client("<YOUR API KEY>");
sparky.Transmissions.Send(transmission);

But I always get the error
{ "errors": [ { "message": "required field is missing", "description": "recipients or list_id required", "code": "1400" } ] }
Maybe the recipients won't be serialized correctly?

Domain has been verified.

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