Fix undefined index error that occurred when sending email