show us your schematic (drawing) of wiring ..
What kind of interface do you have between PORTD Output and your solenoid ?
what is the resistor value of your selenoid ? and usual voltage ?
That's the way to activate an output. However, hardware is important too. Disconnect solenoids and see if the line raises. If it works and when you connect soldenoid, it stops working, then you need to look for the issue in your hardware. I also assumed your solenoids are not stepper motor coils!
if it works with a led connected bettwen OUTput D and 0V trough a resistor of 330 ohms (or less)
output=1 Led bright ON ?
if yes,
Specsheet data of MOSFET 100V-40A ? .. command gate level for MOSFET ON, must be < 5 volts.
and how do you connect the resistor 1 k.
Any diode accross solenoide ?