You can build an email message via code from within the customization.
Checkout this link instead of the previous posted code.
In aaron’s code, the last line can be just
client.SendAsync(message,null);