![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to know if the mailx command really sends the mail to the email address? | sheenshine | Shell Programming and Scripting | 3 | 09-17-2008 09:34 AM |
| write the script to get the file size and sends an email | s_linux | Shell Programming and Scripting | 10 | 08-14-2008 12:54 AM |
| running sql script and email it | adzuanamir | UNIX for Dummies Questions & Answers | 3 | 07-07-2008 05:13 AM |
| Shell script not running thru Cronjob | gauravshrinivas | Shell Programming and Scripting | 8 | 11-03-2006 10:17 AM |
| Variables are not getting exported while running the script in cronjob | csaha | Shell Programming and Scripting | 7 | 03-21-2006 04:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Running script that sends an html formatted email fails when its run as cronjob
Hi
Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem. Im working with typo3 and an extension called aux_newsmailer. The extension, when working properly, is suppose to send out newsletter automatically to users. Either formatted as plain text or html. My problem is that the extension has a backend userface where you manually can send the newsletters which works. Also, running the mailer script from a terminal works fine. When I, however, tries to run the script from a cronjob the html mails are somehow not received by all users and those mails that does are not formatted correctly, images are missing and links are not formatted the right way. I have concluded that the error has something to do with the sending/formatting process but thats all I know. Has anyone any idea what might be the problem? /Nightowl |
|
||||
|
Ok, I have been around this before and the environment is quite different, though, Im not sure which variables the script depends on or how to change the variables like PATH. How is this done?
I have tried to type: PATH=/root/bin etc, but this returns an error Can you help? |
|
|||||
|
Quote:
Quote:
Quote:
|
|
||||
|
I dont think any of the variables are actually used or I just dont get it
![]() Here is the shell script written in php: #! /usr/bin/php -q <?php // set typo path to point to the root of the T3 installation $typopath='/var/www/typo3/mysite/'; // create a BE user called _cli_auxnewsmailer (must not be admin), for better security change it to somethine else. $MCONF['name'] = '_CLI_auxnewsmailer'; // ***************************************** // Standard initialization of a CLI module: // ***************************************** if (@is_file($typopath.'typo3conf/ext/aux_newsmailer/mod1/index.php')) $modulepath=$typopath.'typo3conf/ext/aux_newsmailer/'; else $modulepath=$typopath.'typo3/ext/aux_newsmailer/'; // Defining circumstances for CLI mode: define('TYPO3_cliMode', TRUE); //$BACK_PATH = '../../../../typo3/'; define('TYPO3_mainDir', 'typo3/'); define('PATH_thisScript',$typopath.'typo3/typo3'); define('TYPO3_MOD_PATH', $modulepath.'/mailer/'); // Include init file: require($typopath.'typo3/init.php'); require($typopath.'typo3/sysext/lang/lang.php'); $LANG=t3lib_div::makeInstance('language'); $LANG->init('default'); require($modulepath.'mod1/class_auxnewsmailer_core.php'); $mailer=new tx_auxnewsmailer_core; $mailer->init(); $mailer->batch($argv[1],'',''); ?> I typed in the PATH=/root/bin in the top of this document and the error returned was PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/typo3/mydomain/typo3conf/ext/aux_newsmailer/mailer/mailer.sh:3) in /var/www/typo3/mydomain/typo3_src-4.2.1/t3lib/class.t3lib_userauth.php on line 278 |
|
|||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|