Hi Daniweb Team,
I saw the below code in following url.When i implement this code i does not receive any email.I need to send email via error_log function.Can any one tell me how to do this .For your reference i mentioned the code below.
URL:
http://www.w3schools.com/php/func_error_log.asp

<?php
$test=2;
if ($test>1)
{
error_log("A custom error has been triggered",
1,"someone@example.com","From: webmaster@example.com");
}
?>

Note: When sending an email, it must contain a From header. This can be set with this parameter or in the php.ini file.

Thank you,
Prem

Recommended Answers

All 4 Replies

How to check my smtp settings are correct or wrong.

Member Avatar for rajarajan2017

Goto your PHP.ini file (search from XAMP folder)

1. Open the file in notepad
Search keyword ([mail function])
2. [mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost //Change your smtp address
; http://php.net/smtp-port
smtp_port = 25 //Change port if you need

Thats it!

And you need to be sure that the from address is allowed to send emails using that smtp server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.