Я не могу отправить почту с локального хоста с помощью PHP скрипт это мой кодКак отправить электронную почту в php с localhost?
<?php
ini_set("SMTP","[email protected]");
ini_set("smtp_port","25");
ini_set('sendmail_from', '[email protected]');
//define the receiver of the email
$to = '[email protected]';
//define the subject of the email
$subject = 'Test email';
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail.";
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: [email protected]\r\nReply-To: [email protected]";
//send the email
$mail_sent = @mail($to, $subject, $message, $headers);
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
php.ini файл ...
[Спецрассылки]
; Только для Win32.
SMTP = локальный
smtp_port = 25
; Только для Win32.
sendmail_from [email protected]
из положить является "Почта не удалось"
, пожалуйста, помогите мне решить мою проблему.
Я сомневаюсь, что «bhoi.test @ gmail» - это smtp-сервер – PeeHaa