Mastitis is responsible for substantial economic loss and significant animal welfare concerns for the dairy industry. Sensors that measure electrical conductivity (EC) and enzyme concentrations of lactate dehydrogenase (LDH) are presently used for automatic detection of mastitis. However, EC is not sensitive enough to detect mastitis, and the ability of LDH activity to identify mastitis caused by different pathogens is a potential option that needs to be investigated. This study was conducted to test the following hypotheses: (a) strict foremilk before milk ejection is more informative in detecting mastitis, in general, than foremilk removed after cows were stimulated for milk ejection; and (b) the value of LDH activity as a mastitis indicator depends on the type of pathogen associated with the infection. Milk samples (before afternoon milking) from 48 Holstein-Friesian cows at the University of Sydney's dairy farm (Camden, New South Wales, Australia) with EC > 7.5 mS/cm in any of the 4 quarters were collected over a period of 2 mo. Quarter milk samples (n = 343) from 48 cows were collected manually in the automatic milking rotary in 3 steps: foremilk before (strict foremilk) and after milk ejection, followed by an aseptic sample for bacteriological culture. The EC (mS), LDH (U/L), SCC (cells/mL), and milk protein and fat content (%) of foremilk in both sampling times were compared and used as predictors for gram-positive and gram-negative mastitis. Quarter (n = 515) observations from 44 cows were analyzed using a logistic mixed or linear mixed model, with cow and quarter nested within cow as random effects. Milk from both sampling times was also assessed by producing a receiver operating characteristic (ROC) curve and calculating the area under the curve (AUC) to determine ability to detect mastitis. Overall, EC and LDH were greater and milk protein (%) was lower in strict foremilk than in milk fractions obtained after milk ejection. Data from strict foremilk samples had slightly higher AUC values (0.98 to 0.99 vs. 0.97 to 0.98, respectively) than did the afterejection milk samples. Although gram-negative coliform mastitis had significantly higher LDH activity than did gram-positive mastitis (6.19 vs. 5.34 log 10 U/L), the robustness of this result is questionable due to limited sample size. We concluded that milk samples taken before ejection can influence major mastitis indicators, suggesting that automatic milking system sensors could be modified to monitor milk before ejection for more efficient mastitis detection.