Sporanox capsule is also used to treat onychomycosis (fungal infection in the fingernails or toenails). Itraconazole tablet is only used to treat onychomycosis of the toenails. This medicine works by killing the fungus or yeast and preventing its growth.