The fractional cable equation is studied on a bounded space domain. One of the prescribed boundary conditions is of Dirichlet type, the other is of a general form, which includes the case of nonlocal boundary conditions. In real problems nonlocal boundary conditions are prescribed when the data on the boundary can not be measured directly. We apply spectral projection operators to convert the problem to a system of integral equations in any generalized eigenspace. In this way we prove uniqueness of the solution and give an algorithm for constructing the solution in the form of an expansion in terms of the generalized eigenfunctions and three-parameter Mittag-Leffler functions. Explicit representation of the solution is given for the case of double eigenvalues. We consider some examples and as a particular case we recover a recent result. The asymptotic behavior of the solution is also studied.