HTML / PHP Subscribe Email List Form

Hey Guys!
I’m trying to get this code to work. It came in a HTML template but I cant figure out how to get it to send the email address to me. All I want them to do is type their email then it send that email address to my email. Here is the HTML code.

[php]


Subscribe to our newsletter






[/php]

Any help is much appreciated!

You need a server-side language to send you an email, html cannot do that.

I noticed that but I cant find any info on how to make a simple php file to send that.

Have you tried anything on your own?

[php]

<?php if (!empty($_POST)) { if (! filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) echo "

That is not a valid email.

"; else { $body = <<<MSG Your message. {$_POST['email']} subscribed. MSG; if (mail('[email protected]', 'New Subscriber', $body)) echo "

Your message has been sent.

"; else echo "

There was an issue sending your message. Please try again.

"; } } ?>
Subscribe to our newsletter
[/php]

I’m okay with editing some PHP but I cant write it from scratch.

Sponsor our Newsletter | Privacy Policy | Terms of Service