изпращане на съобщения - PHP
<?php
$to = 'recipient@yahoo.com';
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: mygmail@gmail.com' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=utf-8';
if(mail($to, $subject, $message, $headers))
echo "Email sent";
else
echo "Email sending failed";
?>
Грешката която получавам е : mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first
Направих всичко това но този път ми дава тази грешка:mail(): Failed to connect to mailserver at "ssl://smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
Програмен код:
<?php
$to = 'recipient@yahoo.com';
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: mygmail@gmail.com' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=utf-8';
ini_set("SMTP","ssl://smtp.gmail.com");
ini_set("smtp_port","465");
if(mail($to, $subject, $message, $headers))
echo "Email sent";
else
echo "Email sending failed";
?>