send email using php

What is the PHP mail function

The PHP mail() function allows you to send emails directly from a script.
PHP use the mail() function to send an email. PHP Mail() function requires three mandatory parameters and two optional parameters. First Three parameters specify the email address, the subject of the mail and the actual message of mail.

mail( to, subject, message, headers, parameters );

Simple example of sending php mail.

Following example will send a simple plain text email to xyz@example.com.

  <?php   
  $to = "xyz@example.com";
  $subject = "My subject";
  $txt = "Hello world! This is simple plain text php mail";
  $headers = "From: webmaster@example.com" . "\r\n" .
  "CC: somebodyelse@example.com";

  mail($to,$subject,$txt,$headers);
?>

How to send HTML email

  <?php   
  $to = "xyz@example.com";
  $subject = "My subject";
  $txt = "Hello world! This is simple plain text php mail";
  $headers = "From: webmaster@example.com" . "\r\n" .
  "CC: somebodyelse@example.com";

  mail($to,$subject,$txt,$headers);
?>
<html>
<head>
<title>Sending HTML email using PHP</title>
</head>
<body>
<?php
$to = "xyz@example.com";
$subject = "This is subject of mail";
$message = "<b>This is HTML message.</b>";
$message .= "<h1>This is headline.</h1>";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$header = "From: PHPKIDA  \r\n";

$mailto = mail ($to,$subject,$message,$header);
if( $mailto == true )
{     echo "Message sent successfully...";   }
else   {     echo "Message could not be sent...";   }
?>
</body>
</html>

How skip span folder / How can we skip or send direct mail into inbox

Just put @ symbol before your mail function.

@mail ($to,$subject,$message,$header);
// That code will be send direct mail into inbox

PHPKIDA Offering Free Tools:

INSTA DOWNLOADER

Free online tool to download Instagram videos, photos and save Instagram videos, photos to your device. It's free & easy to use.

Download Now

CURRENCY CONVERTER

Our real time currency converter calculator will convert your money based on current values from around the world. It's free & easy to use.

Convert Now

ROBOST.TXT GEN.

Create robots txt file that help search engines to crawling and indexing your site with help of our free online Robots.txt Generator tool.

Create Now

HTML MINIFIER

Free online tool to minify or compress html code and reduce the size of html code in few clicks. It's free & easy to use.

Minify Now

CSS MINIFIER

Free online tool to minify or compress css code and reduce the size of css code in few clicks. It's free & easy to use.

Minify Now

JAVASCRIPT MINIFIER

Free online tool to minify or compress javascript code and reduce the size of javascript code in few clicks. It's free & easy to use.

Minify Now

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.