Hi,
I don't know exactly what it was that fixed it, but yesterday I tried putting it back to using the GD2 library just to see what would happen, and it suddenly worked. I must have done soemthing right because the emails that I was having problems with as well suddenly worked yesterday too!
Thanks for your help Gizmo
cheers
Djuma