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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.