I am using sparkpost's java api. I am having this weird behaviour when I am trying to send an email to the same email address. This here works:
Client client = new Client("apikey");
String emailfrom="info@example.com";
client.sendMessage(emailfrom,"info@example.com","subject",null,"html");
However this one here doesn't
client.sendMessage(emailfrom,emailfrom,"subject",null,"html");
Any tips why this is happening? When I have a different address it works both ways: I can first store my string to a variable and then pass it to the function. But when it is the same address it returns the error about bad recipient
{ "errors": [ { "message": "At least one valid recipient is required", "code": 5002 } ] }(Bad Request)