MT#5879 Fix UTF-8 email send. Further fix of memory usage issue.

(cherry picked from commit 0610d530113fc23e229f36b3be847a409cf8bc04)