Create mail send function