AddressMap as forwarder

Discussion for developers using MailEnable.
Post Reply
robdob
Posts: 11
Joined: Wed Mar 09, 2011 4:32 pm

AddressMap as forwarder

Post by robdob »

Hi,

I'm trying to create some alias email forwarders from one mail account/domain name to various other outside domain names. I have a website and would like to assign users of my site a temporary email address which would relay any email sent to it to their real email address:

I noticed that if I just add something to the address map, without first creating a mailbox and then a login is seems to do what I want it to do, as I don't need the user to log in and only want to relay the email onto their real address then is the approach below acceptable?
i.e.

//Create mailbox address mappings
MailEnable.Administration.AddressMap oAddressMap = new MailEnable.Administration.AddressMap();
oAddressMap.Account = "MyDomain.com";
oAddressMap.DestinationAddress = "[SMTP:" + sRealEmail + "]";
oAddressMap.SourceAddress = "[SMTP:" + sEmailAlias + "]";
long nResult = oAddressMap.AddAddressMap();


Thanks in advance.

Post Reply