Online Forum To Support Coders With Technical Assistance - Read Write Execute

How to send email in php ?

Ankit Agrawal
Ankit Agrawal
Published on November 30, 2015 · 1 min read
<?php
$to      = 'your email';
$subject = 'your subject';
$message = 'your message body';
$headers = 'From: from email ' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article What is cUrl Next Article → How to show local json data in chrome using angular JS??