stable code that works but doesn't send email.