In mammary glands, the formation of less-permeable tight junctions (TJs) and the production of antimicrobial compounds like lactoferrin and defensins are important for preventing mastitis. Resveratrol, a polyphenol contained in red grapes, is known to protect mammary epithelial cells (MECs) from oxidative stress; however, oral administration of resveratrol causes a decrease in certain biological processes through conjugation and metabolic conversion. In this study, we determined the beneficial effects of resveratrol on TJs and antimicrobial compounds in cultured goat MECs by adding it to the medium, and in lactating goat mammary glands by topical application for percutaneous absorption. TJ barrier function was evaluated by transepithelial resistance and expression or localization pattern of claudins for culture model in vitro and by somatic cell count, Na+, albumin, and IgG in milk for topical application in vivo. Concentrations of antimicrobial compounds and cytokines were measured using ELISA. Activation of STAT3 was evaluated by Western blotting. Resveratrol strengthened TJ barrier function by upregulating claudin-3 in cultured MECs and topical application to udders reduced somatic cell count, Na+, albumin, and IgG in milk. Resveratrol increased β-defensin and S100A7 levels in cultured MECs and milk. In addition, resveratrol down-regulated cytokine production and STAT3 pathway. These findings suggest that the topical application of resveratrol to udders may be effective in preventing mastitis.