Molecular mechanics calculations were carried out on the molecularly imprinted polymer (MIP) which was constructed from using methacrylic acid and 4-vinylpyridine as co-functional monomers, ethylene glycol dimethacrylate as crosslinking agent, and sulfamerazine(SMZ) as molecular template. Binding energies of 17 sulfonamides with this SMZ-MIP were obtained and binding energies of several other non-sulfonamides were also evaluated for comparison. The results show that sulfonamides bind more strongly than other non-sulfonamides, indicating that SMZ-MIP can act as a medium for extracting sulfonamides.