In this paper, a new construction of vertex algebras from more general vertex operators is given and a notion of quasimodule for vertex algebras is introduced and studied. More specifically, a notion of quasilocal subset(space) of Hom (W, W((x))) for any vector space W is introduced and studied, generalizing the notion of usual locality in the most possible way, and it is proved that on any maximal quasilocal subspace there exists a natural vertex algebra structure and that any quasilocal subset of Hom (W, W((x))) generates a vertex algebra. Furthermore, it is proved that W is a quasimodule for each of the vertex algebras generated by quasilocal subsets of Hom (W, W((x))). A notion of Gamma-vertex algebra is also introduced and studied, where Gamma is a subgroup of the multiplicative group C-x of nonzero complex numbers. It is proved that any maximal quasilocal subspace of Hom (W, W((x))) is naturally a Gamma-vertex algebra and that any quasilocal subset of Horn (W, W((x))) generates a Gamma-vertex algebra. It is also proved that a Gamma-vertex algebra exactly amounts to a vertex algebra equipped with a Gamma-module structure which satisfies a certain compatibility condition. Finally, two families of examples are given, involving twisted affine Lie algebras and certain quantum torus Lie algebras. (C) 2005 Elsevier Inc. All rights reserved.