TLDR;
I think you mixed too many stuff in one method.
I would separate this into different domains, each in a unit, e.g. like UMailSend.pas, USysInfo.pas, and the caller
I usually encapsule separate functions into classes, with static functions/methods.
This behaves same like functions or methods, but keep them under a "namespace" of the class, which could be extended if needed.
type
TMail = class
class function Send( AReceiver, AMessage : String, ...); static;
end;