Deep domain adaptation techniques have recently been the subject of much research in machinery fault diagnosis. However, most of the work has been focused on domain alignment, aiming to learn cross-domain features by bridging the gap between source and target domains. Despite the success of these methods in achieving domain alignment, they often overlook the class discrepancy present in cross-domain scenarios. This can result in the misclassification of target domain samples that are located near cluster boundaries or far from their associated class centers. To tackle these challenges, a novel approach called deep domain adaptation with correlation alignment and supervised contrastive learning (DCASCL) is proposed, which synchronously realizes both domain distribution alignment and class distribution alignment. Specifically, the correlation alignment loss is used to enforce the model to generate transferable features, facilitating effective domain distribution alignment. Additionally, classifier discrepancy loss and supervised contrastive learning loss are integrated to carry out feature distribution alignment class-wisely. The supervised contrastive learning loss leverages class-specific information of source and target samples, which efficiently promotes the compactness of samples of the same class and the separation of samples from different classes. Moreover, our approach is extensively validated across three diverse datasets, demonstrating its effectiveness in diagnosing machinery faults across different domains.