codeIgniter send mail with attechment not work-Collection of common programming errors

$path=$this->email->config->item('server_root');
$file=$path.'/mail_demo/attechment/mytext.txt';

my mail is not sent,i don’t know what wrong there is generate following error Undefined property: CI_Email::$config

Originally posted 2013-11-09 22:38:42.