rewrite mail extension

rewrite mail extension to enable multiple addresses