Sinisterly
Send an E-Mail in PHP - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: PHP (https://sinister.ly/Forum-PHP)
+--- Thread: Send an E-Mail in PHP (/Thread-Send-an-E-Mail-in-PHP)



Send an E-Mail in PHP - Dreamzje - 08-10-2015

Have you always wanted to know how to send a email via php code? Well I'm about to tell you. This doesn't work on local host so if your trying this then you will need some hosting to test it out.

It's as simple as this.

Code:
<?php $to      = 'nobody@supremeforums.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@supremeforums.com' . "\r\n" .    'Reply-To: webmaster@supremeforums.com' . "\r\n" .    'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>

Enjoy