Email functionality in core php