mail generation, tested on static variables, /mail url working