We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SmtpClient.SendAsync ingnores the MailMessage.ReversePath property

Hello,

the is a bug in the SmtpClient.
The MailMessage.ReversePath is properly used by the Send method but the SendAsync (the async version of this method) is ingnoring this property.

Regards
Robert

Hi Robert,


Thanks for writing to Aspose.Email support team.

We have analyzed the requirement and need more assistance to proceed further.

Could you please send us the sample console application which can be used to reproduce the issue as it will help us to assist you as soon as possible. Please be informed that it is necessary to reproduce issue before logging any bug in our issue tracking system.

Your cooperation and patience is highly appreciated in this regard.

Hello,

here is a code sample that demonstrates the correct behavior of the Send method:

MailMessage message = new MailMessage();
message.From = "me@mydomain.com";
message.To = "doesnotexist@foreigndomain.com");
message.ReversePath = "bouncesmailbox@mydomain.com";
SmtpClient client = new SmtpClient(“mysmtpserver”);
client.Send(message);

The expected behavior is that a bounce email should arrive to the bouncesmailbox@mydomain.com address. In case, when the Send() method is used, this works es expected.

here is a sample code where i use SendAsync instead:

MailMessage message = new MailMessage();

message.From = "me@mydomain.com";

message.To = "doesnotexist@foreigndomain.com");

message.ReversePath = "bouncesmailbox@mydomain.com";

SmtpClient client = new SmtpClient(“mysmtpserver”);
client.SendCompleted += OnSendCompleted;

client.SendAsync(message, null);


In this case the bounce email arrives to the address me@mydomain.com which is not the expected outcome.

Regards
Robert

Hi Robert,


Thanks for providing supporting material.

We have tried to re-produce the issue using our available test accounts on public SMTP servers but could not succeed in getting back bounced mails to the ReversePath email address. This is because it can be re-produced on those SMTP servers which support this functionality. As we are using public SMTP server like GMail, Yahoo etc. so they don’t provide this feature to avoid spam mails.

Could you please provide us credentials of a sample test account on the SMTP server which you are using for your testing. It will help us to re-produce the issue and assist you further. Also please keep this account available until the issue is resolved.

As this thread is public so you may also mark it as private before sending the test account credentials.

We are thankful for your patience and understanding in this regard.

Hello,

i am sorry but i can’t provide any access to a SMTP server. But that is not a problem, the sending does not need to be successful to see the difference between Send() and SendAsync().

Simply enable logging for your SmtpClient and you will see in the logfile that in case of Send() the SmtpClient sends a MAIL FROM command that looks like:

MAIL FROM:bouncesmailbox@mydomain.com

which is correct.

If you use SendAsync() you will see:

MAIL FROM:me@mydomain.com

which is incorrect.

Regards
Robert

Hi Robert,


Thanks for providing supporting information.

We have analyzed the information and have successfully reproduced the issue here. We have passed all the information to the development team and will write back here as soon as some feedback is received from the developers.

Thanks again for all the assistance and cooperation to reproduce the issue.

This issue is logged in our issue tracking system as NETWORKNET-33502.


The issues you have found earlier (filed as NETWORKNET-33502) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.