Victoria Laithwaite, who was a governor at HMP Onley, previously admitted the offence.
The 47-year-old from Kislingbury, Northamptonshire was sentenced with prisoner James Chalmers.
At Northampton Crown Court, Judge Adrienne Lucking QC said it was a "highly inappropriate" relationship.
Laithwaite was head of safer custody and equalities at the category C prison when arrested in May 2021, after two mobile phones were found in the cell of Chalmers, 30, from Coventry.
The court heard Laithwaite had twice tried to call one of the phones.
WhatsApp messages later recovered suggested a relationship, the court heard.
In one Laithwaite wrote "yeah but I was worried when I didn't hear from you. Thought you ditched me" and in another she called Chalmers "babe".
The defence barrister for Chalmers, Sarah Allen, described the relationship as "intimate", although the defence barrister for Laithwaite said there was no "physical relationship".
Defending Laithwaite, Shanice Mahmud, said her client was "deeply ashamed" and "utterly embarrassed" that she had "single-handedly destroyed her own life" and destroyed the lives of her husband, children and her parents.
The court heard she was "deeply remorseful".
A victim impact statement from the prison's deputy governor said "corruption" in a prison can have an impact that was "far reaching" and affect "confidence of the public" and "trust between staff and prisoners".
Judge Lucking said Laithwaite was responsible for a "serious breach of trust" but said her sentence was reduced because of mitigating factors including the loss of her sister before the offence, a diagnosis for PTSD, and the impact a prison sentence would have on her family.
Chalmers was sentenced to 24 months for possessing a mobile phone inside a prison.
The court heard he had 46 previous convictions.
Det Insp Dan Evans said: "This was serious misconduct on [Laithwaite's] part and only serves to erode confidence in the service as well as potentially undermine the complete security and good order needed to run a prison."
"She willingly encouraged a prisoner to commit an offence," he said.