All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
First of all, we would like to thank you for writing to us and asking about the rulings of the religion on the matters that concern you. However, we would like to draw your attention to the gravity of your conduct, namely befriending and talking to non-Mahram (marriageable) men. It is impermissible for the Muslim woman to befriend a non-Mahram man, and so is talking to him, except for a need and within the limits of the etiquette of Islam. Please refer to fatwa 81356 in this regard. You must repent to Allah, the Exalted, and resolve to never do this again. For the conditions of repentance, please refer to fatwa 86527.
As for forgetting the matter regarding which you had made the oath, you should confine yourself to acting upon what you are certain of, according to the relevant Fiqhi rule which states that 'the fundamental principle is the non existence of something (Al-Asl Al-'Adam)', i.e. there was no oath before you made it, so only take into consideration the part of it that you are certain of. If you broke your oath, you are required to offer expiation in the manner we explained in fatwa 82135.
It remains to be said that if you had talked to these young men while forgetting your oath and you cared about that oath to such an extent that had you not forgotten it, you would not have broken it, then you are not required to offer expiation according to some scholars, like the Shaafiʻis. This was also one of the reported opinions of the Hanbalis and the chosen opinion of Shaykh Al-Islam Ibn Taymiyyah .
As we said above, it is impermissible for you to talk to those young men; however, this is not betrayal of this man's trust; rather, it is betrayal against yourself and neglect in avoiding what you are forbidden to do as a Muslim woman. It is impermissible for you to tell him of what you did, because you are required by the Shariah to conceal your sins. Abu Hurayrah reported that the Prophet, sallallaahu ‘alayhi wa sallam, said:
"All the sins of my followers will be forgiven, except those of the Mujaahireen (those who commit a sin openly or disclose their sins to the people). An example of such disclosure is that a person commits a sin at night, and though Allah screens it from the people, he comes in the morning and says, 'O so-and-so, I did such-and-such (sin) last night,' though he spent his night screened by his Lord (none knowing about his sin), and in the morning he removes the screen of Allah from himself." [Al-Bukhari and Muslim]
Allah knows best.