Added mailer functionality. And fixed multiple record xml calling.