Enviar Registro por Correo electrónico: Rigorous treatment of electrostatics for spatially varying dielectrics based on energy minimization