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 :

$config['useragent'] = 'Code-Igniter-Mailer-^^'
$config['mailtype'] = 'text'
$config['validate'] = TRUE;
$config['protocol'] = 'smtp'
$config['smtp_host'] = 'localhost'
$config['newline'] = "\r\n";

$this->email->from('youremail@yourdomain.com', 'Your Name');
$this->email->reply_to('youremail@yourdomain.com', 'Your Name');
$this->email->subject('Email Subject');
$this->email->message('Your Message Here.');