completed Mail Script Task Code
Debuged and fixed email error