3
Domain Aliases - Set the From address based in the login domain
Idea shared by jorge.mx.neto - 5/12/2015 at 12:40 PM
Proposed
I'm sure this was already present in the old forum, but for reference for all who need to setup the From Address the same as the domain you are using in one of the Domain Aliases.
 
This was tested in version 6.x, 12.x and 15.x:
 
Make a backup of the file:
\Program Files (x86)\SmaterTools\SmarterMail\MRS\Main\frmCompose.aspx
 
And add  the following code to the end of file just before the closing tag (</script>):
 
//Added to change the from address based on the login domain
    var ddFromListClientID = '<% =ddFromList.ClientID %>'
    var ddFromList = document.getElementById(ddFromListClientID);
    var urlDomain = getURLDomain();
    for(index = 0; index < ddFromList.length; index++)
    {
        if (urlDomain.toLowerCase() == getEmailDomain(ddFromList[index].text).toLowerCase())
     {
      ddFromList.selectedIndex = index;
      ddFromList.onchange();
      break;
     }
    }function getEmailDomain(email)
    {
        var index = email.indexOf('@');
     return email.substring(index + 1);
    }
    function getURLDomain()
    {
     var url = window.location.host;
     var index = url.indexOf('.');
     return url.substring(index + 1);
    }
 
Then test by log in by two different domains and you'll see that the From email address changes in the compose window.

Reply to Thread