Well the emails worked, but I did have some shoddy code in there, and it involved whiles in whiles which are always fun (at least it was just whiling through a query, so at least you know it will end somewhere...). There was one thing I should have stuck in a function but it wasn't working and I was tight for time... eugh