This article explores the strategic role of digital marketing in enhancing the sustainable attractiveness of smart cities, with a specific focus on Casablanca, Morocco. By integrating digital technologies such as the Internet of Things (IoT), data analytics, and artificial intelligence, Casablanca aims to address urban challenges related to sustainability, including transportation, waste management, and energy efficiency. This study employs a mixed-method approach, combining qualitative interviews with urban planners and digital marketing experts, alongside quantitative analysis of smart city performance indicators. Five smart cities across different continents were selected to provide comprehensive insights and contextualize the findings for Casablanca. The results demonstrate that targeted digital marketing strategies, when well-implemented, play a crucial role in improving citizen engagement, environmental awareness, and resource optimization, while reinforcing Casablanca's position as a sustainable smart city in Africa.