The message means that req.err has the value undefined.
Add this statement before MsgBox("Error sending " & req.err):
console.log(req)
Run it again. Open the Chrome Debugger to the Console window. You should be able to see more about what is being returned in req.