Send Simple Mail Function using PHP

Send Simple Mail Function using PHP

In this Post We Will Explain About is Send Simple Mail Function using PHP With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to PHP check if mail() function is enabled on your serverExample

In this post we will show you Best way to implement PHP mail() function simple test script, hear for Test and send mail using PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

PHP mail() function simple test script


Also Read This ๐Ÿ‘‰   Vue.js onclick Event Handling Example

First of all check your Mail available or disabled Your Domain Check.and then The simple php mail() function all the allows you to simple send emails using PHP directly from a php script.

if ( function_exists( 'mail' ) )
    echo 'Good Work, Your mail() is available';
    echo 'Sorry !! , Your mail() has been disabled';


Access to your simple hosting via SSH or FTP

Create the simple-mail.php script with the following:

ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "[email protected]";
$to = "[email protected]";
$live_subject = "Simple PHP Mail Test Live script";
$your_live_message = "This is a My First test Email to check the supported PHP Mail functionality or not.";
$live_headers = "From:" . $from;
try {
  $data = mail($to,$live_subject,$your_live_message,$live_headers);
catch(Exception $e) {
  echo 'Message: ' .$e->getMessage();

Test PHP mail functionality

Before we can send simple PHP mail, it is very important to test the send PHP mailโ€™s functionality. we can use the simple following source code saved into a PHP file with a .php extension:

Also Read This ๐Ÿ‘‰   How To Create Contact Form With PHPMailer To Send Mails

 $headers = 'From: [email protected]';
 mail('[email protected]', 'Test email using PHP', 'Wel come - This is a test First email message', $headers, '[email protected]'); ?>

Important: We recommend using an simple PHP SMTP relay that requires must be authentication. Sending mail through all the users unauthenticated SMTP servers so (most of the including as well as the localhost relay on any Cloud Sites) can simple result in or any delays or mail undelivered email because reason of stringent or any anti-spam filters.


I hope you have Got What is Test PHP mail functionality And how it works.I would Like to have FeadBack From My Blog( readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article( Are Most Always Welcome.