That is often true, although if your substrate (alkyl halide) is primary, you will probably get mostly SN2 product, unless your base is bulky. Two things should immediately tip you off that a reaction goes by E2: one is a strong, bulky base like t-butoxide or LDA (lithium diisopropylamine), and the other is the heat symbol, which looks like a triangle (it's the greek letter delta). Heat tends to favor eliminations over substitutions in general. If the substrate is secondary and you mix it with a strong base, you may still get some SN2 product, but E2 will probably predominate. And if it's tertiary, E2 is the only possibility.