Automatically apply: Go to Mail > Preferences > Rules > Add Rule, set rules, go to Set Color > of background > Other, and select a color.