fixed the mail sending for local environments and prod