0 votes

I'm working on a mailing function where all emails are stored as emls.
When a new answer email is being prepared, it will load the last stored eml as IMail and reply to that

Problem is, that if the last mail was a message from the function, the new mail will be send to the mailing system itself, not to the first mail address.

How can the TO (FirstUser-Address) and FROM (MailingSystem-Address) be tweaked with a full body reply (including the body of the last eml file)?

Would be nice to have a hint.


PS: Also have email-address + email-name on a reply address.
Like "original.Reply(address, name);"

by (1.8k points)
edited by

1 Answer

+1 vote
Best answer

Got it working with this:

// Rewriting the FROM to the first eml
var toFix = new MailBox(eml.OwnerEmail, eml.OwnerName);
ReplyBuilder replyBuilder = original.Reply();

Email address and email display name problem - simply use MailBox instance:

MailBox from = new MailBox(mailer.EmailAddress, mailer.EmailName);
by (1.8k points)
You can always set From and/or To properties on the resulting MailBuilder or IMail instance.