Use tempfiles to pass email content to avoid shell escape errors