Send Mail using Php


Now Todays we will lean “send mail using php”. It simple method to send email using php codes. There are some field require to process this php script. These are like as To, Subject, Message, From. You can also extend all other option its depend on your requiremet. This guide to beginner for “send mail using php”.

Send Mail using Php Step 1:

Create File with name sendmail.php and paste above codes in it.

<?php
$to = "toaddress@mailservername.com";
$subject = "Just a test mail";
$message = "Just training on php";
$from = "fromaddress@mailservername.com";

Now we define the parameters to,suject,message and header containing from and reply address. In script header is the area where user set the from address, reply to address, cc address, etc.

/* To send HTML mail, you can set the Content-type header. */

$headers1 = "MIME-Version: 1.0\r\n";
$headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers1 .= "To: ".$to."\r\n";
$headers1 .= "From: ".$from."\r\n";
$headers1 .= "Reply-To: ".$from."\r\n";
?>

Send Mail using Php Step 2:
 
Now send the mail through Php Api

<?php
mail($to, $subject, $message, $headers);
?>
 You have done Send Mail using Php !
Share:

Enable featured image wordpress


This Post Describe ‘How enable Featured image in Wordpress?For this your theme is updated with higher version of Wordpress. If you have not latest version of wordpres then Download the latest version.  If you not see ‘Featured Image’ In Wordpress Admin Panel at right-bottom side when you create new Post then you have need to enable this option.

To Enable “Feature Image” in Wordpress, you need to add the following codes to functions.php template file:

Example:

// Add support for Featured Images
if (function_exists('add_theme_support')) {
        add_theme_support('post-thumbnails');
        add_image_size('index-categories', 150, 150, true);
        add_image_size('page-single', 350, 350, true);
}

Above written code you see that can help to enable  “Featured Image” in Wordpress. Now you can go to Wordpress Admin Panel and click on “Screen Options”.  There is option with title “Featured Image”. Be Sure the box is checked of “Featured Image”

You have done!
Share: