Add new features, support encode headers (part from gen_smtp)