1

When I'm sending email via mailgun, must I specify a 'to' recipient?

In some cases, I'd prefer to specify only 'Bcc' recipients.


EDIT: I've already tried to do this on my own and I receive a

'Bad Request - 'to' parameter is missing' error.

I just wanted to know if there's another way around this, because typically you can send an email without a 'To' recipient, so long as you specify a CC or Bcc recipient.

2
  • 1
    then it's probably an api restriction. use yourself as the To:, or a dedicated junk address which just dumps the mail to /dev/null.
    – Marc B
    Dec 21, 2015 at 16:46
  • Related: stackoverflow.com/q/28503099/109941
    – Jim G.
    Dec 21, 2015 at 16:47

2 Answers 2

3

You may not send mail only using bcc. There is a trick I use in which I make the from and to the same address (something like info@mydomain.com) and then fill up the bcc slot with whatever I need.

You may send mail using mailing lists that does not require you to expose other email addresses.

https://documentation.mailgun.com/en/latest/api-mailinglists.html

3
  • Can we specify an empty mailing list? Because if I am sending mails in 10 batches, the mail address in to will get the mail 10 times... So, to avoid that, it is a good alternative? Sep 11, 2019 at 12:43
  • @ptmdevncoder You may not specify an empty to which is why you use your own email as a to email. This way it doesn't matter how many emails go to the dummy email. Sep 11, 2019 at 23:23
  • I did not say an empty TO. I meant to say, adding a valid mailing list created at mailgun end but with 0 entries in it. Making it an empty mailing list. But, the TO field won't be empty due to the presence of that empty mailing list. Sep 12, 2019 at 5:38
0

Eventually, the SMTP call is being translated to a call to the SMTP provided which is usually not forced to have a 'to' recipient, but the best way is to perform a test where you send an email with only 'bcc' recipient (you can send it to yourself as a test'

1
  • 1
    OK. Another workaround (beside the mailing list option) is to have the sender email address also in the 'to' list.
    – yorammi
    Dec 21, 2015 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.