One way would be to hook the sofia::unregister event with an .lua script and then send an email from the script or get the script to schedule an email for sending by some other process.
EDIT: Just tested this with pulling the cable out of the phone, the event does not get fired when the registration eventually expires.