stijnh
(Iam)
December 12, 2010, 8:57pm
1
I want error mails when I the site generate error, but with this configuration I doesnt get any mails …
// Log configuration
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => 'CFileLogRoute',
'levels' => 'error, warning',
),
array(
'class' => 'CEmailLogRoute',
'levels' => 'error, warning, info',
'emails' => => 'mail@mail.com',
'sentFrom' => 'mail@mail.com',
'subject' => 'Error at mysite.com site',
),
),
),
zaccaria
(Matteo Falsitta)
December 13, 2010, 7:25am
2
You should configure ‘emails’ => ‘mail@mail.com’, to be a valid mail, also you have a strange syintax here.
Try also to run the command mail() in php, if it doesn’t work in means that you have to configure a valid smtp
stijnh
(Iam)
December 13, 2010, 8:22am
3
zaccaria:
You should configure ‘emails’ => ‘mail@mail.com’, to be a valid mail, also you have a strange syintax here.
Try also to run the command mail() in php, if it doesn’t work in means that you have to configure a valid smtp
Where you see a strange syntax?
And where can I set my SMTP server?
qwerty
(qwerty)
December 13, 2010, 8:59am
4
'emails' => => 'mail@mail.com',
should be
'emails' => 'mail@mail.com',
stijnh
(Iam)
December 13, 2010, 9:12am
5
qwerty:
'emails' => => 'mail@mail.com',
should be
'emails' => 'mail@mail.com',
Yes, I misspelled it, when I typed the example (not in my code)
mdomba
(Maurizio Domba Cerin)
December 15, 2010, 7:18am
7
How can you expect someone to help you if you write only “still doesn’t work”…
have you tried the standard PHP function mail()… does it send mails?
If it does, then it’s something with the config in Yii…
if it doesn’t then it’s something with the settings on your system…
stijnh
(Iam)
December 15, 2010, 8:21am
8
mdomba:
How can you expect someone to help you if you write only “still doesn’t work”…
have you tried the standard PHP function mail()… does it send mails?
If it does, then it’s something with the config in Yii…
if it doesn’t then it’s something with the settings on your system…
I’m Sorry, here some better information:
I changed the mail() function in my own mail extension. But I still doesn’t receive any mails when I enter a wrong url.
When I create a test function with my own mail extension, I receive mails.
So my question, when will the sendMail function in CEmailLogRoute.php activated?
mdomba
(Maurizio Domba Cerin)
December 15, 2010, 8:45am
9
It’s called from CEmailLogRoute->processLogs()… sendEmails() calls the PHP mail() function… so I don’t understand what you mean with your “own mail extension”
FlyBot
(Flybots)
December 15, 2010, 12:47pm
10
Edit your PHP.INI file. Go to the [mail function] section and modify it
stijnh
(Iam)
December 15, 2010, 1:15pm
11
I create an own extension for mailing, and that function I call in sendEmails()
mdomba
(Maurizio Domba Cerin)
December 15, 2010, 1:19pm
12
OK, but to be clear what is wrong here… have you tried withouth your extension… just the Yii implementation… does it send mails?
stijnh
(Iam)
December 15, 2010, 2:19pm
13
Found the error !
// Preloading 'log' component
'preload' => array('log'),
Did not add this to my config/mail.php
mdomba
(Maurizio Domba Cerin)
December 15, 2010, 2:30pm
14
Nice catch… glad you found it