I'm trying to send a simple PHP mail from my web page but there is something wrong of course.
php.ini
[mail function]
; For Win32 only.
; https://php.net/smtp
SMTP = send.one.com
; https://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; https://php.net/sendmail-from
sendmail_from =
[email protected]
Web page
<!DOCTYPE html>
<html lang="en">
<head>
<title>Email test</title>
<meta charset="utf-8" />
</head>
<body>
<h1>Email test</h1>
<h2>Testing PHP email</h2>
<br><br>
<h3></h3>
<?php
$to = "
[email protected]";
$subject = "Email test";
$message = "This is an email test";
if (mail($to, $subject, $message))
{
echo "Email sent";
}
else
{
echo "Email failed";
}
echo 'email processed';
?>
</body>
</html>