Smtp.Send two times at once (<1s difference) problem

0 votes
asked Jul 17, 2015 by dirk (530 points)

Hello,

today a rather strange problem occured:
I tried to send two mails with less than 1s difference in time; while the first got sent correctly, the second didn't receive, I ended up with the following exception:
"One or more recipients rejected. Call SmtpException.GetRejectedRecipients() to get a collection of rejected email addresses.”

Is time an issue here? Do I need to wait between a sending period? If yes, how could I implement a valid routine to allow the correct sending process of both mails.

Thanks,
d.rk

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Jul 17, 2015 by Lukas Pokorny (100,710 points)

Time does not matter to the Smtp object, so this is most likely a server issue. Could you please create a communication log showing both successful and unsuccessful attempts and either post them here or mail them to us for analysis? That should make it possible to tell why the server is rejecting the message.

Also, please note that the array returned by SmtpException.GetRejectedRecipients() contains a list of rejected addresses along with SMTP server responses, and those are likely to contain additional information as well (the same as the log).

commented Apr 5, 2017 by dsouzac (420 points)
What is resolution of this case? As i am also facing it so interested to know. Please let me know.

In my case when any email comes application send (auto) reply which works. but when agent replies to that email it fails with Rejected recipients. I have verified in both the case same function and same user is used.

We have Rebex 2016 R3 version - 2.0.6198.0

Thanks in advance.
commented Apr 5, 2017 by Lukas Pokorny (100,710 points)
We never got the log or any additional information, so we were unfortunately unable to tell why those recipients were rejected.

However, if you are facing a similar issue, the original answer still applies. To determine error status codes and error messages for rejected recipients, call SmtpException's GetRejectedRecipients() method. It returns an array of SmtpRejectedRecipient objects - one for each recipient. Alternatively, create a communication log that should make it possible to tell what is going on and why the recipients were rejected.
commented Apr 5, 2017 by dsouzac (420 points)
I will create communication log but as of now i have information on Rejected Recipient along with response.

Rejected recipient: Undisclosed recipients:; Response:501 5.1.3 Invalid address
commented Apr 5, 2017 by Lukas Pokorny (100,710 points)
This looks like SMTP client tried sending an email to "Undisclosed recipients:;" mail address. This is used as a placeholder address when sending e-mail to multiple recipients and should have been skipped by Rebex SMTP client. The server is behaving correctly and rejects the placeholder address. We will fix this and send you a link to a hotfix as soon as possible. Thanks for reporting this issue!
commented Apr 6, 2017 by dsouzac (420 points)
Ok Thanks.

Would like to know if there is any work around for this till the hot fix is available?
commented Apr 6, 2017 by Lukas Pokorny (100,710 points)
There is - when sending the e-mail, construct a string from recipients' addresses and pass it to Smtp object's Send method as 'recipients' argument (and pass null for 'sender' argument). Make sure to omit the "Undisclosed recipients" entries. The 'recipients' argument is a colon-delimited list of mail addresses:

            smtp.Send(message, null, "someone@example.org;support@rebex.net");

However, the hotfix should be available within days.
commented Apr 6, 2017 by dsouzac (420 points)
wow that would be great.

We have Rebex 2016 R3 version - 2.0.6198.0.
however we need fix for rebex version 2.0.6026.0 too.

Thank you Lukas
commented Apr 6, 2017 by Lukas Pokorny (100,710 points)
Sorry, we don't routinely backport hotfixes to older releases. Please use the official workaround code instead: http://forum.rebex.net/6953/smtp-send-fails-sending-mail-undisclosed-recipients-make-work?show=6954#a6954
commented Apr 6, 2017 by dsouzac (420 points)
ok but let us know for latest version hotfix.
commented Apr 17, 2017 by dsouzac (420 points)
is this hot fix is included in your's latest release Rebex 2017 R2? or when it will be available?
commented Apr 17, 2017 by Lukas Pokorny (100,710 points)
The hotfix will be released with Rebex Secure Mail 2017 R3. In the meantime, please use the workaround Send method from http://forum.rebex.net/6953/smtp-send-fails-sending-mail-undisclosed-recipients-make-work?show=6954#a6954
commented May 10, 2017 by Lukas Pokorny (100,710 points)
We have released Rebex Secure Mail / Rebex Total Pack 2017 R3 that incorporates this hotfix: http://www.rebex.net/total-pack/history.aspx#2017R3 Thanks for bringing this issue to our attention.
...