For those using Send Mail functionality in Acumatica, there is almost always a problem with SMTP servers, they may not process your e-mail due to certain conditions are not met.
For example, you may have Office 365 account and willing to add it to Acumatica as a system E-Mail account.
There will be an issue when other persons start sending mails from Acumatica, as Office 365 server require Sender to be exactly your account name or at least a person from your domain.
There could also be a case when you set up Acumatica in your internal domain, and are not willing to expose / connect it directly to a public mail server.
Easiest way to avoid these problems is to install an SMTP Relay server at your office. Well this is not really a hardware box server, just a piece of software running on one of your machines, it could even run on Acumatica server itself, as it does not depend on anything, well at least we don't want it to.
So I was looking for a good candidate for SMTP relay with some "alter" functions on the outgoing e-mails and found this software: EMailRelay Software
This is not just open source, freeware, SMTP relay. It is also a Message Transfer Agent. Meaning it can change the Envelope of your E-Mail, it can also change the content of the Header or Body of your E-mail.
This is perfectly what we need - to alter "From:" address, in case of Office 365 usage.
Also this software can work as a server. I will not go deep into installation procedures, it is simple enough, just download correct version (32 or 64 bit) then unpack it, run the configurator, it will guide you through simple steps. Put Office 365 Server as a relay server. Make sure port 25 is open for incoming E-Mails. You can also configure it as a service, to run when you log off from the machine.
Now, the most interesting part, altering the body of the message and envelope.
What it does: when message is received from Acumatica, but not yet relayed to Office 365 SMTP, there is an option - to run Java Script and alter the content of the E-Mail.
Please make sure you added a call into a BAT file that system created for SMTP relay, to invoke these alterations. --filter parameter.
All the best,