IMHO creating a class file on the fly and putting it in the site's files folder is not really a good idea, especially for production sites.
The files folder is not normally in version control, and I am often running into the problem of it missing when I switch developer environments. In general, the files folder just isn't reliable.
Especially since currently, for some reason, Drupal will try to include the generated sites/default/files/mailsystem/HTMLMailSystem__SmtpMailSystem.mail.inc file on every page, causing a fatal error if it is missing, but that is for another issue.
I get that it might be the best way to generate and save the file, but there should at least be another way to include the file, such as maybe the sites/all/libraries folder, or a custom module folder?
There may already be a way to do this, but its just not documented?
If I can figure this out I'll make a patch.