One of Fourier's most important works was the identification of what is now called the Fourier Series. The series can be computed in two forms.
The first form: (1)
with (2)
and (3)
The second form: (4)
with (5)
The function, x(t), must meet a set of conditions (Dirichlet) in order for the Series to exist and converge. In order to model the sampling process, we need to know the Fourier Transform of an elementary sampling function, s(t):
We find the transform via the Fourier Series!
so
and
using the results for the transform pair involving impulses.
If x(t) is periodic in the window, the Fourier Series expansion (equations (1) and (4) above) may be used to approximate x(t) for all values of t. If x(t) is not periodic, the expansion still is (periodic in T). The upshot of this last characteristic is (for example): if you compute the Fourier Series for a sine function, using 3/4 of the function's true period as the time window, T, the expansion will approximate the sine function within the chosen window, but, if expanded outside the window, will converge to a function that is periodic in the window. The expansion in this example will have rapid jumps every T time units.

Plot of the function 5*sin(2*pi*t). Four cycles are shown. This function has only one frequency, 1 Hz.
If we compute the Fourier Series coefficients, Xn, using equation (5). Only two terms are non-zero-- those at +/- 1 Hz.

A standard way of plotting a spectrum generated from Fourier Series-- the line spectrum. This plot is derived from the magnitudes of the Xn's (the coefficients are generally complex numbers). Values can be plotted only at frequencies that are multiples of 1/T. In this case, T=1 second.
If we choose a time window other than an integral number of periods, the Series and the reconstruction may differ significantly from the example just shown. For example, let's use a 0.75 second window:

A time window that is not an integral number of cycles of the original sine function.

Line spectrum for the truncated window. Note there are many components (only the lower frequency ones are shown), and that the d.c. (n=0) term is no longer zero. The Fourier Series computations see only the 0.75 second function, not an entire cycle of sine.
If we reconstruct the signal using equation (4), with a finite number of terms, and, we allow time to go beyond the 0.75 second window, we get:

Reconstructed function from Fourier Series coefficients (light line) and original sine function (dark line). The reconstruction uses coefficients up to +/- 25, and shows a tendency to "ring" near discontinuities (Gibb's Phenomenon). Note the quality of the reconstruction within the original 0.75 second time window.