Home
  Products
  Downoad
  Documentation
  Services
  User login
 

SMTP Mail Class manual


Contents

Introduction
How do I use SMTP Mail Class?

version 1.0

ChangeLog

Back

Introduction

The only PHP function that supports this is the mail() function. However, it does not expose any of the popular features that many email clients use nowadays like HTML-based emails and attachments.

With the releases of later versions, which is only accessible in the presence of a paid-for Alangor Program Studio publishing license.

Back

How do I use SMTP Mail Class?

Version 1.0

Show current version (using the querystring in the URL)

http://www.yourdomain.com/IncludeClassFile.php?version

Example

<?
// include the class file
include_once "smtp.class.php";


// create the class object and predefine the function
$mail=new smtp_class;


# email setting
$mail->Host            = "localhost";  // SMTP server.
$mail->Port            = 25;  // SMTP port. Default: 25;
$mail->Timeout        = 10;  // SMTP connection timeout. Default: 10;
$mail->Timezone        = "+0800";  // Time Zone. Default: "+0000";
$mail->Priority        = 3;  // Email priority Default: 3 (1=High,3=Medium or 5=Low);
$mail->CharSet        = "big-5";  // Character set.
$mail->WordWrap        = 0;  // characters per line. 0 for umlimit characterc per line
$mail->IsHTML        = true;  // HTML email. Default: false (true or false);
$mail->MailerDebug    = false;  // Display SMTP error. Default: false (true or false);
$mail->AuthLogin    = false;  // using SMTP authorization. Default: false (true or false);
$mail->AuthUser        = "SMTPlogin";  // SMTP username
$mail->AuthPass        = "SMTPpassword";  // SMTP password


# email address and content start here
$mail->From("Email","Name");
$mail->AddTo("Email","Name");
$mail->AddCc("Email","Name");
$mail->AddBcc("Email","Name");
$mail->AddReplyTo("Email","Name");
$mail->Subject="Email Subject";
$mail->Body="Email Message";


# add attachment
$mail->AddAttachment("filename.ext");


# define attachment content
$mail->AddAttachmentContent("attachment content","attachment_filename.ext");


# check email success or fail with your own program
if(!$mail->Send()){
     echo
"Email Fail";
}else{
    echo
"Email Success";
}


?>

 

Back

ChangeLog

Version 1.0 (2006-05-09)

  • Added Host parameter.
  • Added Port parameter.
  • Added Timeout parameter.
  • Added Timezone parameter.
  • Added Priority parameter.
  • Added CharSet parameter.
  • Added WordWrap parameter.
  • Added IsHTML parameter.
  • Added MailerDebug parameter.
  • Added AuthLogin parameter.
  • Added AuthUser parameter.
  • Added AuthPass parameter.
  • Added From() function.
  • Added AddTo() function.
  • Added AddCc() function.
  • Added AddBcc() function.
  • Added AddReplyTo() function.
  • Added Subject parameter.
  • Added Body parameter.
  • Added AddAttachment() function.
  • Added AddAttachmentContent() function.
  • Added Send() function.
Back