In this paper we deal with the problem of constructing efficient rules for the numerical evaluation of integrals of functions which are very smooth everywhere in the domain of integration, except at the boundaries where they possess mild singularities. In particular, we consider integrals defined on bounded intervals or on triangles. Integrals of this type appear, for example, in the numerical solution of singular and weakly singular integral equations by boundary element methods.