문제

How do I specify smtp host on log4php I will be using it with gmail using the following configurations.

smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
도움이 되었습니까?

해결책

You don't say what OS this relates to - On a Microsoft platform. log4php uses PHP's mail command - but this is implemented differently on Microsoft (SMTP TCP client) compared with every other operating system (uses local binary program via stdio).

The simplest way around this would be to modify the LoggerAppenderMail to use phpmailer or swift mailer in place of the php mail() command.

But if you'd rather not tinker with the standard libs and have to maintain your own patchset, then you should set up a local MTA which can smart relay via SSL with authentication e.g. ssmtp or msmtp. Of course you can use a full blown MTA like postfix or sendmail if you really want.

다른 팁

You just need to follow the instructions in the Appender documentation for log4php available here.

What you need would be the following appender types:

LoggerAppenderMail
LoggerAppenderMailEvent
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top