Every time I send email, the email always discarded by hosting mailer. Here the error :

Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings

After couple time trying, I found the error was generated when I use ‘mail’ PHP function. When we use mail() function to send email, we got “Sender: Nobody <nobody@yourhosting.com>” in email header. And that’s why my email always discarded by my hosting mailer.

I change the email send method by using SMTP ( using fsockopen() ). Because I use CodeIgniter , the email send code will be like this :

$this->load->library(&#39email&#39);
$config[&#39useragent&#39] = &#39Code-Igniter-Mailer-^^'
$config[&#39mailtype&#39] = &#39text'
$config[&#39validate&#39] = TRUE;
$config[&#39protocol&#39] = &#39smtp'
$config[&#39smtp_host&#39] = &#39localhost'
$config[&#39newline&#39] = "\r\n";
$this->email->initialize($config);

$this->email->initialize($config);
$this->email->from(&#39youremail@yourdomain.com&#39, &#39Your Name&#39);
$this->email->reply_to(&#39youremail@yourdomain.com&#39, &#39Your Name&#39);
$this->email->to(&#39someemail@somedomain.com&#39);
$this->email->subject(&#39Email Subject&#39);
$this->email->message(&#39Your Message Here.&#39);
$this->email->send();