Thermohaline convection (THC) in porous media is frequently investigated using the problem of porous enclosure. Most of the existing modeling-based studies are limited to 2-D simulations, because 2-D assumption is widely used to deal with computational requirement of 3-D numerical solutions. Analytical solutions serve as an alternative to deal with computational requirement of numerical solutions. Existing analytical solutions of THC are mostly limited to 2-D and also under steady-state regime. In this work, we develop a meshless 3-D semianalytical solution for the problem of THC in a porous box under crossed thermal and solute gradients, for both steady state and transient regimes. The semianalytical solution is developed using the Fourier series (FS) method applied to the vector potential form of the governing equations. The extension to transient solutions represents an important technical feature of this work, as the applications of the FS method to density-driven problems have been limited to steady-state conditions. The FS solution is validated against a finite element solution obtained using COMSOL Multiphysics. Numerical experiments show the worthiness of the developed FS solution as a benchmark because it clearly allows making distinction between different numerical techniques. The effects of governing parameters on three-dimensional THC have not been investigated previously. We perform a detailed parameter sensitivity analysis to address this gap. A vortex convective flow is observed and the orientation and intensity of the flow is sensitive to the gravity number. The increase in the temperature gradient reduces the salinity flux.