Mail is sending as localhost from Ubuntu server

515 Views Asked by At

Hello I am sending a mail from my server.

If I run it directly on the server I get a proper url but when the cronjob is processed the url is with local host. I am using CodeIgniter framework running on Ubuntu 13.04 with ssmtp

This is my encode :

$yes = site_url('job/itemExtend/?id=' . urlencode($this->encrypt->encode($itemid)));
$no = site_url('job/itemFree/?id=' . urlencode($this->encrypt->encode($itemid)));

My cronjob:

10 0 * * * php /var/www/TakeAway/index.php job checkTakeAways
1

There are 1 best solutions below

0
On

PHP uses separate ini files depending on the environment :

  • php.ini
  • cli/php.ini
  • cgi/php.ini

Make sure you have configured them all correctly to specify the option