This is probably because debris has been trapped in the u-bends of your piping and has begun to rot, causing a stink. Most pipes have these u-bends in them to catch debris before it finds its way into the sewer line and clogs it. There are a couple of ways you can clean the u-bends. You can either take it apart and do the cleaning by hand, or you can flush it with vinegar and bleach to break up the debris. The broken up debris will then move easily through the pipe without blocking it. In order to get rid of the smell, turn on the fan or air conditioning and it will be sucked up.