0

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)
tim.a
  • 83
  • 1
  • 1
  • 10
  • I just tried it and both cases worked for me. I am expecting that the second use-case you have the `email from` domain is not your registered domain. But when I tried that use case I got the following error and not the one you are getting: { "errors": [ { "message": "Invalid domain", "description": "Unconfigured Sending Domain ", "code": "7001" } ] }) – Yepher Mar 27 '19 at 16:58
  • I still get the same behaviour unfortunately. I use it on a spring app but i don't think that this has anything to do with the problem. Anyways not a big issue but it is weird.. – tim.a Mar 29 '19 at 09:47

0 Answers0