PHP Classes

File: ABG_SMTP_Test.php

Recommend this page to a friend!
  Classes of Gilbert BENABOU   ABG_SMTPMail   ABG_SMTP_Test.php   Download  
File: ABG_SMTP_Test.php
Role: Example script
Content type: text/plain
Description: Send Email via SMTP (Test script)
Class: ABG_SMTPMail
Send e-mail messages via SMTP
Author: By
Last change: Improvements & bug fixes
Date: 17 years ago
Size: 2,392 bytes
 

Contents

Class file image Download
<?php
 
##############################################################################
  # Project : ABG_SMTPMail #
  # File : ABG_SMTP_test.php #
  # V1.0.0 26/03/2006 : Initial #
  # V1.1.0 21/05/2006 : Improvements & fit to new classes #
  # V1.1.1 21/05/2006 : Minor bug fixes #
  # (cy) G. BENABOU / ABG Soft PARIS FRANCE #
  # #
  # A PHP 4 script to test the ABG_SMTP Classes #
  # #
  ##############################################################################

  // Choose (uncomment) the script you want to use (only one at a a time !!)
  // require ("ABG_SMTP.inc.php"); // Full features
  // require ("ABG_SMTP_Lite.inc.php"); // Lightened
  /*** Definitions ************************************************************/
 
$server = "smtp.provider.com"; // SMTP server URL
 
$login = "J-Smith"; // Authentification login; blank if not used
 
$pwd = "m3d*rez4d"; // Authentification password (if authent.)
 
$from = "jsmith@provider.com"; // Sender email address

  // List(comma separated) of recipients (ABG_SMTP.inc.php)
  // Unique recipient (ABG_SMTP_Lite .inc.php)
 
$to = "you@somewhere.com[, darling@heaven.net]";

 
// List(comma separated) of more recipients
  // $cc & $bcc used by ABG_SMTP.inc.php only; left for compatibility
 
$cc = "Bill@microsoft.com, angel@hell.org";
 
$bcc = "top@secret.org";
 
$subject = "The subject of the message is ...";
 
$body = "Here is the body of the message; you can insert \n (newlines) ..";

 
/*** Instantiate object and run **********************************************/
 
$smtp = new ABG_SMTPMail($server);

  
// Get the result of the transaction and reports
 
$Result = $smtp->ob_SendMail( $login, $pwd, $from, $to, $cc, $bcc, $subject, $body);
  echo (
$smtp->ob_Status);
  echo (
$Result ? "Message sent succesfully!" : "Error sending message \n $smtp->ob_Error");
?>