PHP Classes
elePHPant
Icontem

File: test_pickup_message.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manuel Lemos  >  MIME E-mail message sending  >  test_pickup_message.php  >  Download  
File: test_pickup_message.php
Role: Example script
Content type: text/plain
Description: Script to test the pickup_message class
Class: MIME E-mail message sending
PHP mailer to compose and send MIME messages
Author: By
Last change: Changed the default mailroot directory example setting to an empty string.
Date: 3 years ago
Size: 1,524 bytes
 

Contents

Class file image Download
<?php
/*
 * test_pickup_message.php
 *
 * @(#) $Header: /opt2/ena/metal/mimemessage/test_pickup_message.php,v 1.2 2004/09/22 20:13:26 mlemos Exp $
 *
 */

   
require("email_message.php");
    require(
"pickup_message.php");

   
$from_name=getenv("USERNAME");
   
$from_address="me@address.com";
   
$reply_name=$from_name;
   
$reply_address=$from_address;
   
$reply_address=$from_address;
   
$error_delivery_name=$from_name;
   
$error_delivery_address=$from_address;
   
$to_name="Manuel Lemos";
   
$to_address="mlemos@acm.org";
   
$subject="Testing Manuel Lemos' Email Windows pickup sending PHP class";
   
$message="Hello ".strtok($to_name," ").",\n\nThis message is just to let you know that your Windows pickup e-mail sending class is working as expected.\n\nThank you,\n$from_name";
   
$email_message=new pickup_message_class;

   
/*
     * Set this to your mail server root directory.
     * Set it to an empty string to let the class determine the directory
     * path automatically checking the registry.
     */
   
$email_message->mailroot_directory="";

   
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name);
   
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
   
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
   
$email_message->SetHeader("Return-Path",$error_delivery_address);
   
$email_message->SetEncodedHeader("Subject",$subject);
   
$email_message->AddQuotedPrintableTextPart($email_message->WrapText($message));
   
$error=$email_message->Send();
    if(
strcmp($error,""))
        echo
"Error: $error\n";
?>