Should have kept separate sendmail script