It can be found in the function called "AddSendSubMenu".
Search for the string variable called "L_SendToEmail_Text". Once you find
this, this is the section that is used to render the link. The actual email
link is generated by concatenating a few other variables together into a
variable called "fileURL". This is all then pushed into a JavaScript
function called "navigateEmailToLink". The JavaScript collects values from
the "ItemTable", mainly the Server URL then substrings part of it and
concatenates it to the "currentItemUrl" along with a few extras.