A new algorithm for automatic computation of solitary wave solutions to nonlinear partial differential equations based on the Exp-function method. A new algorithm and its Maple implementation AEFM are presented to find exact solitary wave solutions of nonlinear partial differential equations (PDEs) in terms of the Exp-function method. It turns out that the program can perform the Exp-function method entirely automatically and output directly solitary solutions to ($n+1$) dimensional PDEs. Furthermore, the package allows users to find desirable solutions with different input parameters. The effectiveness of the algorithm is illustrated by applying it to a variety of equations.