In the present review fundamental aspects of near-field optics are described paying particular attention to phenomena of importance in optical imaging. Near-field optics has allowed us to go beyond the classical diffraction limit and study structures of subwavelength extension with fight. Only concepts from classical optics are needed to understand most of the underlying physics, and in a mainly descriptive manner I first discuss the classical theory of near-field optics. Starting from the famous Helmholtz-Kirchhoff integral theorem I introduce the so-called evanescent electromagnetic field which constitutes the backbone of important near-field optical methods such as those based on the principles of frustrated total internal reflection and optical surface wave (plasmon, polariton) excitation. Also near-field tomography, a subject I touch on in relation to a discussion of diffraction from an inhomogeneous slab (e.g. a biological preparation) relates directly to evanescent fields. From a microscopic classical point of view the electromagnetic field of the point dipole is of central importance in near-field optics, and theoretical investigations of the multiple scattering among dipoles have enabled us to describe the strong electromagnetic interaction which inevitably occurs between the object under study and the near-field detector, and to make experimental use of various kinds of local-field resonances. The point dipole model also is the springboard to the quantum world of near-field optics. The need for a quantum physical understanding emerges with our wish of observing even smaller objects (mesoscopic particles, single molecules and atoms) with near-field optics. It is not known where the spatial resolution limit is in near-field optics, and the interpretation of near-field data becomes more complex as we approach the atoimic length scale. Most of the ongoing physical studies in the quantum domain are of hindamental nature, and linked to deep problems in physics such as causality, photon propagation in space-time, and photon tunnelling. In the final part of my review I seek to give the reader a glimpse of the quantum world of near-field optics, a world we would like to understand better in its own right, but also in order to develop the next generation of high-resolution near-field optical microscopes.