Prashank
01-15-2012, 01:01 PM
hi! friends,
I am working on a php script and this is below
send.php
<?php
require_once('inc/header.inc.php');
require_once('design.inc.php');
require_once('profiles.inc.php');
require_once('utils.inc.php');
require_once('EmailTemplates.php' );
$oEmailTemplates = new EmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed');
sendMail($site['email_notify'], 'test mail', $aTemplate['Body']);
?>
so when i visit example.com/send.php this script send a mail and that is okay but i am trying this
function sendAdminMail() {
$oEmailTemplates = new EmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed');
sendMail($site['email_notify'], 'test mail', $aTemplate['Body']);
}
this is the function but i want this to execute from another file something like this.
visit.php
return $this -> oModule -> sendAdminMail();
so, when i visit example.com/visit.php the same thing should happened and a mail should be sent.
but nothing happeneds i am not an advance coder of php so i am making some mistake can you all tell me what is the mistake and what to do?
any help will be very appreciated.
Thanks.
I am working on a php script and this is below
send.php
<?php
require_once('inc/header.inc.php');
require_once('design.inc.php');
require_once('profiles.inc.php');
require_once('utils.inc.php');
require_once('EmailTemplates.php' );
$oEmailTemplates = new EmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed');
sendMail($site['email_notify'], 'test mail', $aTemplate['Body']);
?>
so when i visit example.com/send.php this script send a mail and that is okay but i am trying this
function sendAdminMail() {
$oEmailTemplates = new EmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed');
sendMail($site['email_notify'], 'test mail', $aTemplate['Body']);
}
this is the function but i want this to execute from another file something like this.
visit.php
return $this -> oModule -> sendAdminMail();
so, when i visit example.com/visit.php the same thing should happened and a mail should be sent.
but nothing happeneds i am not an advance coder of php so i am making some mistake can you all tell me what is the mistake and what to do?
any help will be very appreciated.
Thanks.