Engine from an '07 AT Mazda 3 into an '04 MT Mazda 3

I have a 2004 Mazda 3 2.3L MT which needs a new engine. I’ve found a great deal on a 2.3L Mazda 3 engine, but it’s from a 2007 (same body style as '04) with an automatic transmission. Would the different year and transmission type cause any compatibility issues with swapping these engines?

Do you need to pass an emissions test? Getting the CEL to go out might be a challenge. Your ECM (the engine computer) might not be compatible with the newer engine…The '07 AT ECM will not like the stick shift and will certainly light up the CEL if it works at all…

Engine swapping is all but impossible with todays emissions laws and electronic controls…