PHP Classes
elePHPant
Icontem

File: mailtest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  MIMEMail  >  mailtest.php  >  Download  
File: mailtest.php
Role: Example script
Content type: text/plain
Description: example
Class: MIMEMail
Send via SMTP a MIME message with attached files
Author: By
Last change:
Date: 10 years ago
Size: 831 bytes
 

Contents

Class file image Download
<?php

 
require ("mimemail.inc.php");

 
///If you have'nt downloaded SMTP class required in mimemail class then
  // just comment the require file and uncomment the php mail function in send function in class.
  //
 
 
$fp=fopen("mimemail.inc.php","r");
 
$data=fread($fp,filesize("mimemail.inc.php"));
 
fclose($fp);

 
$mail=new MIMEMAIL();
 
$mail->from="HARISH<harishc@templatearena.com>";
 
$mail->to="harish<harishc@templatearena.com>";
 
$mail->cc="Tapan<tapank@templatearena.com>;manoj<manojk@templatearena.com>";
 
$mail->subject="welcome";
 
$mail->body="<b>This is test mail.don't reply it.</b>";
 
$mail->html=true;
 
$mail->add_attachment($data,"mimemail.inc.php" ,"application/octet-stream" );
  if(!
$mail->send())
    echo
"Error in sending mail!";
  else
    echo
"Mail sent succesfully!";

?>