  The rainbow connection number, $rc(G)$, of a connected graph $G$ is the
minimum number of colors needed to color its edges so that every pair of
vertices is connected by at least one path in which no two edges are colored
the same. We show that for $\kappa =3$ or $\kappa = 4$, every
$\kappa$-connected graph $G$ on $n$ vertices with diameter $\frac{n}{\kappa}-c$
satisfies $rc(G) \leq \frac{n}{\kappa} + 15c + 18$. We also show that for every
maximal planar graph $G$, $rc(G) \leq \frac{n}{\kappa} + 36$. This proves a
conjecture of Li et al. for graphs with large diameter and maximal planar
graphs.
