15998-scheduler-test.diff

Administrator Admin, 2010-10-16 19:24

Download (1.83 KB)

View differences:

typo3/sysext/scheduler/examples/class.tx_scheduler_testtask.php (Arbeitskopie)
22 22
*  This copyright notice MUST APPEAR in all copies of the script!
23 23
***************************************************************/
24 24

  
25
require_once(PATH_t3lib . 'class.t3lib_htmlmail.php');
26

  
27 25
/**
28 26
 * Class "tx_scheduler_TestTask" provides testing procedures
29 27
 *
......
91 89
				. 'cronCmd: ' . ($cronCmd ? $cronCmd : 'not used');
92 90

  
93 91
				// Prepare mailer and send the mail
94
			$mailer = t3lib_div::makeInstance('t3lib_htmlmail');
95
			$mailer->start();
96
			$mailer->from_email = $this->email;
97
			$mailer->from_name = 'SCHEDULER TEST-TASK';
98
			$mailer->replyto_email = $this->email;
99
			$mailer->replyto_name = 'SCHEDULER TEST-TASK';
100
			$mailer->subject = 'SCHEDULER TEST-TASK';
101
			$mailer->setPlain($mailer->encodeMsg($mailBody));
102
			$mailer->setRecipient($this->email);
103
			$mailer->setHeaders();
104
			$mailer->setContent();
105
			$success = $mailer->sendtheMail();
92
			try {
93
				/** @var $mailer t3lib_mail_message */
94
				$mailer = t3lib_div::makeInstance('t3lib_mail_message');
95
				$mailer->setFrom(array($this->email => 'SCHEDULER TEST-TASK'));
96
				$mailer->setReplyTo(array($this->email => 'SCHEDULER TEST-TASK'));
97
				$mailer->setSubject('SCHEDULER TEST-TASK');
98
				$mailer->setBody($mailBody);
99
				$mailer->setTo($this->email);
100
				$mailsSend = $mailer->send();
101
				$success = ($mailsSend>0);
102
			} catch (Exception $e) {
103
				throw new t3lib_exception($e->getMessage());
104
			}
106 105
		} else {
107 106
				// No email defined, just log the task
108 107
			t3lib_div::devLog('[tx_scheduler_TestTask]: No email address given', 'scheduler', 2);