Feature #10045 Replace mail function to new mail API
http://tracker.modx.com/issues/10045