Hi,
I’m new to PHP.
I need to send email without providing any password in settings. First of all is this possible?
If possible, what are the settings needed to be done in php.ini and in any other settings required?
I have my php script as below :
<?php
echo "Hello World!";
ini_set("SMTP","ssl://smtp.gmail.com");
ini_set("smtp_port","587");
$to_email = '[email protected]';
$subject = 'Testing PHP Mail';
$message = 'This mail is sent using the PHP mail function';
$headers = 'From: vidhyajsv@gmai\r\n';
$headers .="Content-type: text/html\r\n";
mail($to_email,$subject,$message,$headers);
And i’m getting below error when I execute php script.
Warning: mail(): Failed to connect to mailserver at "ssl://smtp.gmail.com" port 587, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp64\www\emailapp\index.php on line 18.
Please help me on this.