Hi,
I created a registration app in which the ordinary user will fill up an information from it. My worries was i badly need to log first as admin before the mail functionality of my code will work. How can give the anon user a permission to send mails even if it is not an admin account?
// this will work only if i logged as admin
function mail_form(&$content)
{
$messsage=’
Name: |
‘.$content[“first_name”].’ '. $content[“last_name”].' |
Email:
|
‘.$content[“email”].‘ |
Phone: |
’.$content[“phone”].’ |
';
$content['msg'] = $messsage;
if ($GLOBALS['egw_info']['apps']['notifications']['enabled'])
{
$receiver = 'gilpoligrates@gmail.com';
try
{
// print('try');
$notification = new notifications();
$notification->set_receivers(array($receiver));
$notification->set_message($messsage); // set message as plaintext
$notification->set_message($messsage); // and html
$notification->set_sender($content[email]);
$notification->set_subject("Rate Request");
$notification->send();
}
catch (Exception $exception)
{
// print('catch');
$this->errors[] = $exception->getMessage();
return false;
}
}
else
{
error_log('tracking: cannot send any notifications because notifications is not installed');
}
}
Any help will be great!
Thanks,
Gil Poligrates