in reply to sending emails with attachements via gmail

Several of the modules in that thread are by RJBS, who has additional modules that can handle attachments, such as Email::Stuffer. Untested, but try something like this instead of the Email::Simple code in that thread:

Email::Stuffer ->from($smtp{user}) ->to($smtp{to}) ->subject($smtp{subject}) ->text_body($smtp{body}) ->attach_file('example.txt') ->transport($transport) ->send;