The em waves are said to be the oscillations o electric and magnetic field perpendicular to each other and to the direction of propagation of wave and hence transverse.
However consider a charged particle oscillating along x axis with no motion along y and z axis. Let it be at O. Consider a point P where we are considering the electric field due to charge. When the particle moves from O to A, the electric field at P increases. And when it goes from O to B, the electric field at P decreases by an equal amount. Since the charged particle is in SHM, the electric field at P will vary sinusoidally. However the varying electric field is also in direction of X axis. And the wave also propagates in this direction. So, it comes out to be longitudinal. However since magnetic field variation will be in perpendicular direction to electric field, it will also be perpendicular to direction of propagation of wave. So the wave should be partially longitudinal and partially transverse.