Welcome Guest, Not a member yet? Register   Sign In
Automatic mail sending
#11

[eluser]defectivereject[/eluser]
If you're on a Mac, i found this link the much easier of any to follow.
Fairly straight forward infact.
http://drupal.org/node/434416
#12

[eluser]Atharva[/eluser]
Forgot to mention, you can connect to db in cron file using settings from system/application/database.php as follows
Code:
mysql_connect($db[$active_group]['hostname'],$db[$active_group]['username'],$db[$active_group]['password']) or die("Error in correction");

mysql_select_db($db[$active_group]['database']) or die("Error in selecting database");
#13

[eluser]Roy MJ[/eluser]
Thankyou.. I think it'l work.. Ive been thinking i cant use pure php inside codeigniter. Now its making sense. Thankyou..
#14

[eluser]Roy MJ[/eluser]
Ok here is what i am getting from mailer demon

/bin/sh: php/home/aromaren/public_html/cron.php: No such file or directory

My cron.php looks looks like this:

Code:
<?php
define('BASEPATH',1);
require('../system/application/config/database.php');
require('../system/application/config/config.php');
/*$con = mysql_connect($db['default']['hostname'],$db['default']['username'],$db['default']['password']);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db($db['default']['database'], $con);

$functiontype = $_GET['functiontype'];
$id     =     $_GET['id'];
switch($functiontype){
    case 'cars_id' : list_cars($id);
                        break;

}
mysql_close();*/
                $recipient = "[email protected]"; // Who the email is too
                $subject = "aroma";
                $message ="helooooooo";
                    $frm_name = "bigiil";
                    $email "[email protected]";
                    $mailheader = "From: $frm_name\r\n";
                    $mailheader .= "Reply-To: $email\r\n";
                    $mailheader .= "MIME-Version: 1.0\r\n";
                    mail($recipient, $subject, $message, $mailheader)
?>


The command i gave in the cpanel is : php/home/aromaren/public_html/cron.php


The error says there is no file or directory ..Can you see what i am doing wrong?
#15

[eluser]Atharva[/eluser]
Can you execute this file through browser ans see what happens?
#16

[eluser]Roy MJ[/eluser]
When i access it through browser i am getting this :


Warning: require(../system/application/config/database.php) [function.require]: failed to open stream: No such file or directory in /home/aromaren/public_html/cron.php on line 3

Warning: require(../system/application/config/database.php) [function.require]: failed to open stream: No such file or directory in /home/aromaren/public_html/cron.php on line 3

Fatal error: require() [function.require]: Failed opening required '../system/application/config/database.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aromaren/public_html/cron.php on line 3
#17

[eluser]Atharva[/eluser]
If cron.php is on root folder, then remove '..'
Code:
require('system/application/config/database.php');
require('system/application/config/config.php');
#18

[eluser]Roy MJ[/eluser]
Heyy.. Solved..!!!!!.. Actually i was using require function ... When i changed to include as u had told earlier it worked well.. Thanks a lot..
#19

[eluser]Roy MJ[/eluser]
Yes i have changed that too.. Thanks a lot..




Theme © iAndrew 2016 - Forum software by © MyBB