Output pin cannot drive a relay

Or is there any other reason?

Post your testing code and we will see. Possibly you forgot to set the pin mode to output?

Lefty