It looks like you do not want to use FouierSeries
? Because you asked similar question before. But if you want to do it yourself, then you can just use the definition. (You say you want complex F.S. but you are using the standard F.S. in your question).
$$
f\left( x\right) \sim\sum_{n=-\infty}^{\infty}c_{n}e^{in\frac{2\pi}{T}x}
$$
Where $T$ is the period of $f\left( x\right) $. And $c_{n}=\frac{1}{T}
\int_{-\frac{T}{2}}^{\frac{T}{2}}f\left( x\right) e^{-in\frac{2\pi}{T}x} \,dx$
Therefore:
ClearAll[T, x, n, c];
T = 2 Pi; (*period*)
f[x_] := Piecewise[{{Cosh[x], -T/2 < x < T/2}, {0, True}}];
c[n_, T_] := 1/T*Integrate[f[x] Exp[-I 2 n Pi/T x], {x, -T/2, T/2}]
series[nTerms_, T_] := Sum[ c[n, T]* Exp[I 2 n Pi/T x], {n, -nTerms, nTerms}]
And now
series[3,T] (*from -3..3 in the sum*)

Verify
FourierSeries[f[x], x, 3]

To plot:
Plot[{Cosh[x], Evaluate@series[3, T]}, {x, -Pi, Pi}]


Manipulate[
Plot[{Cosh[x], Evaluate@series[nTerms, T]}, {x, -Pi, Pi},
ImageSize -> 400, GridLines -> Automatic,
GridLinesStyle -> LightGray, PlotStyle -> {Blue, Red}],
{{nTerms, 1, "How many terms?"}, 1, 10, 1, Appearance -> "Labeled"},
ContinuousAction -> False,
TrackedSymbols :> {nTerms}
]
FourierSeries
. Since your previous, almost identical question from earlier today received an answer, can you specify why the method proposed in that answer does not work for you here? $\endgroup$