added internal email functionality