I'm creating an application that requires communication between 2 databases, say db1 and db2. The scenario is somewhat like this: in db1, a mail should go from X to Y when X clicks on an action, but only if Z has performed some action in db2.
There are two cases here: one when X clicks his action after Z clicks his action. The other Z clicks his action after X clicks his action.
In the first case, I am checking at X's level whether Z has taken the action and if the action is performed, I'm sending mail to Y.
In the second case, I'm checking at Z's level in db2 whether X clicked on his action and sending mail to Y about db1.
So far, everything's fine. Now what I require is the from address of the mail should always be X even though we are sending from Z level. In the second case above, the mail will go as if it's sent by Z.
Is there anything predefined like we have in doc.Form and doc.SendTo etc. that helps us to change the sender's name?