Laser two-photon ionization of aniline in a molecular beam and the bulk gas phase