0 votes

Suppose I have a message like this:

To: foo@gmail.com, foo@hotmail.com
Cc: foo@yahoo.com

I want to send those messages directly to the destination MX servers, so I need to create 3 SmtpMail classes, one for each recipient.

Is there any helper class to expand a single IMail into multiple SmtpMail messages?

I don't mind coding it, but just want to know if this is already done in the library.

by (600 points)

1 Answer

0 votes

Actual message that should be send to the SMTP server(s), must be exactly the same for all 3 recipients. There is no need to create 3 different instances of SmtpMail class.

by (297k points)
Ok, so maybe I'm understanding something wrong.

From some tests, if I just send the same message to all servers, it would emit this for all three servers:

RCPT TO:<foo@gmail.com>
RCPT TO:<foo@hotmail.com>
RCPT TO:<foo@yahoo.com>

Although it would work accept only 1 email in each MX, I don't want to send invalid requests that I know are going to fail.

Or Mail.dll is smart enough to know where I'm connecting to send only the correct commands?
Yes, you are correct. My answer is wrong. I thought of the eml data only and forgot RCPT commands. There is no such feature in Mail.dll. You'll have to modify SmtpMail.Receipients for each  server.
...