Email helper function made more versatile (yet backwards-compatible)