Having trouble with mapi falure

i am trying to send a email from a program and it keeps telling me
(error{mailLib}:: General MAPI failure.
how to fix this