Issue 1489:some improvement in Mail send class, thanks Alan