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

Tools:

Crypto Currency

PHPKIDA provides free online the best real-time crypto market price, news, predictions, index with graphs & historical data for 2000+ coins including bitcoin, ethereum, & altcoins from major cryptocurrency exchanges.

Visite Tool

Icon Generator

PHPKIDA provides free online icon generator. Our icon generator help you to edit, modify, resize and customize icon for your website and applications. Convert to a shap you like add icon border, you can change icon border color, border size, background color, icon shadow, icons color, icon size in your own way and save it as a png image.

Visite Tool

Youtube Video Downloader

PHPKIDA provides Free online YouTube video downloader to download YouTube videos quickly in MP4, 3GP, and more. Search your video and free fast download youtube videos.

Visite Tool

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.