PHP Classes

Easy Reuse Mail Class: Compose and send HTML email with mail function

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 190 All time: 8,589 This week: 140Up
Version License PHP version Categories
easy-reuse-mail-clas 1.0.0GNU General Publi...5Email, PHP 5, Files and Folders
Description 

Author

This class can compose and send HTML email with mail function.

It can compose an email message setting the sender, recipient addresses, subject HTML and text body message alternatives and attached files.

The class assembles a MIME message body and sends it using the PHP mail function.

Picture of Ashok kumar  kashyap
  Performance   Level  
Name: Ashok kumar kashyap <contact>
Classes: 4 packages by
Country: India India
Age: 38
All time rank: 2049127 in India India
Week rank: 321 Up22 in India India Up

Example

<?php
define
('DIR_PATH',dirname(__FILE__));
define('DIR_CONFIG', DIR_PATH.'/config/');

include
"mail.php";
include
"config.php";
$con= new Config();
$con->load("app_setting");

$mail= new Mail();// create mail class object

$mail->setFrom($con->get('from'));
$mail->setTo('ajayashok.01@gmail.com');
$mail->setSender($con->get('appname'));

$mail->setTextMessage('welcom this is html email for testin Thanks <br/>Easy Team.');
if(
$mail->send())
echo
"Your Text email is send successfully!";
else
echo
"Your Text email not send successfully!";



$html_email_message='<h1>welcome</h1> <p>this is html email for testing</p><br /> <br /> <br /> <br /> <h5>Thanks <br/>Easy Team</h5>';
$mail->setHtmlMessage($html_email_message);
if(
$mail->send())
echo
"Your Html email is send successfully!";
else
echo
"Your Html email not send successfully!";



echo
$con->get('appname');



echo
"<br>".DIR_PATH;



?>


Details

# easy-reuse-mail-class

  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Plain text file config.php Class Class source
Plain text file email-template.html Data Template
Plain text file index.html Data Auxiliary data
Plain text file mail.php Class Class source
Plain text file README1.txt Data Auxiliary data
Plain text file test.php Example Example script

  Files folder image Files  /  config  
File Role Description
  Plain text file app_setting.php Conf. Configuration script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:190
This week:0
All time:8,589
This week:140Up