Thanks kev1n, the code actually throughs a couple of errors but after leaving it overnight and coming back to it this morning the original code seems to be working, maybe a cache issue on my part?
It works quite sliently, I'll try and work on using it in conjunction with nuEmail so it pulls the info and puts it in to a seperate form like that used to test email settings so the recipient can be more easily changed by the end user.