Help!! STI?!?

So I have been having unprotected sex for awhile with my boyfriend of 3 years. He is the only person I have ever had sex with but he has had sex with someone else before. I have never had a problem in 3 years with STI's or anything but my period just ended and when i pulled out my tampon there was a yellowish sticky discharge at the end or my tampon and it smelt really bad. Could it just be because i just ended my period or could it be an STI?