You can simply setup the email subscribe form with php and html.

Use the below snippets for the email subscribe

HTML : Subscribe

<form action="subscribe.php" method="post">
<input name="email" id="email"type="text" required id="url" 
placeholder="Enter email address ...">
<input value="Join Now" type="submit">
</form>

PHP : subscribe.php

<?php
$to = "YOUR MAIL ID";  \ Your Mail ID
$from = "no-reply@yourwebsite.com"; \ Replace it with your From Mail ID

$headers = "From: " . $from . "rn";

$subject = "New subscription";
$body = "New user subscription: " . $_POST['email'];
if( filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) )
{
if (mail($to, $subject, $body, $headers, "-f " . $from))
{
echo 'Your e-mail (' . $_POST['email'] . ') has been added to our mailing list!';
}
else
{
echo 'There was a problem with your e-mail (' . $_POST['email'] . ')';
}
}
else
{
echo 'There was a problem with your e-mail (' . $_POST['email'] . ')';
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *