What file is used to create the compose email in sugar 6.5?

I want to customize the From and To parameters during email composition, but I don't know what file is used to create the compose email form. Can anyone point me to the right direction? Also I want to customize the From and To when sending the invoice trough email from the invoice module.

Thank you