handle error in create method
use sendmail to send emails