Common
[ class tree: Common ] [ index: Common ] [ all elements ]

Class: CMNemailMessages

Source Location: /CMNemailMessages.php

Class Overview


This class manages email addresses objects.


Author(s):

Version:

  • 2.0

Variables

Methods



Class Details

[line 33]
This class manages email addresses objects.

Created on 14 aug 08 aug 07

Changes: 1.0 -> 2.0: 03 aug 09 updated: class has been renamed from Emails_Messages() to CMNemailMessages() added: file is PEAR compatible added: to package Common




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  2.0
license:  GNU Public License


[ Top ]


Class Variables

$charset =  "utf-8"

[line 96]

Variable that contains charset encoding



Tags:

access:  public

Type:   string


[ Top ]

$headers =

[line 81]

Variable that contains headers



Tags:

access:  public

Type:   string


[ Top ]

$html =  true

[line 91]

Variable that contains a flag defining if the mail is xHTML or not



Tags:

access:  public

Type:   bool


[ Top ]

$oFrom_email =

[line 60]

Variable that contains STRemailAddresses() object defining from address



Tags:

access:  public

Type:   object


[ Top ]

$oFrom_name =

[line 65]

Variable that contains STRemailAddresses() object defining to address



Tags:

access:  public

Type:   object


[ Top ]

$oMessage =

[line 55]

Variable that contains Strings() object defining message content



Tags:

access:  public

Type:   object


[ Top ]

$oReplyto_email =

[line 70]

Variable that contains STRemailAddresses() object defining replyto address



Tags:

access:  public

Type:   object


[ Top ]

$oReplyto_name =

[line 75]

Variable that contains Strings() object defining replyto name



Tags:

access:  public

Type:   object


[ Top ]

$oSubject =

[line 50]

Variable that contains Strings() object defining subject of the mail



Tags:

access:  public

Type:   object


[ Top ]

$oTo_email =

[line 40]

Variable that contains STRemailAddresses() object defining "To user"

address




Tags:

access:  public

Type:   object


[ Top ]

$oTo_name =

[line 45]

Variable that contains STRfamilyName() object defining "To user" name



Tags:

access:  public

Type:   object


[ Top ]

$parameters =

[line 86]

Variable that contains parameters



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


method MakeHeaders [line 215]

string MakeHeaders( object $this->oTo_name, object $this->oTo_email, object $this->oFrom_name, object $this->oFrom_email, object $this->oReplyto_name, object $this->oReplyto_email, bool $this->html)

Headers maker function

This function is used to make email headers. Headers are returned and stored in $this->headers.

  1.  <?php
  2.  $oEmail                  new CMNemailMessages();
  3.  $oEmail->oTo_name        new Strings("Pierre Dominique Vienne");
  4.  $oEmail->oTo_email       new STRemailAddresses("pvienne@me.com");
  5.  $oEmail->oFrom_name      new Strings("Foo Bar");
  6.  $oEmail->oFrom_email     new STRemailAddresses("foo@example.com");
  7.  $oEmail->oReplyto_name   new Strings("Bar Foo");
  8.  $oEmail->oReplyto_email  new STRemailAddresses("bar@example.com");
  9.  $oEmail->html            false;
  10.  echo $oEmail->MakeHeaders();
  11.  // headersstring
  12.  ?>




Tags:

return:  headers string
since:  version 1.0
usedby:  CMNemailMessages::SendEmail()
uses:  STRemailAddresses()
uses:  Strings()


Parameters:

object   $this->oTo_name   Strings() object defining to name
object   $this->oTo_email   STRemailAddresses() object defining to email
object   $this->oFrom_name   Strings() object defining from name
object   $this->oFrom_email   STRemailAddresses() object defining from email
object   $this->oReplyto_name   Strings() object defining reply to name
object   $this->oReplyto_email   STRemailAddresses() object defining reply-to email
bool   $this->html   flag defining if the message content is HTML

[ Top ]

method SendEmail [line 138]

bool SendEmail( object $this->oTo_email, object $this->oTo_name, object $this->oSubject, object $this->oMessage)

Email sender function

This function is used to send emails. Result is returned

  1.  <?php
  2.  $oEmail              new CMNemailMessages();
  3.  $oEmail->oTo_email   new STRemailAddresses("pvienne@me.com");
  4.  $oEmail->oTo_name    new Strings("Pierre Dominique Vienne");
  5.  $oEmail->oFrom_email new STRemailAddresses("foo@example.com");
  6.  $oEmail->oFrom_name  new Strings("Foo Bar");
  7.  $oEmail->oSubject    new Strings("This is an example");
  8.  $oEmail->oMessage    new Strings("Lorem ipsum dolor sit amet,
  9.       consectetur adipiscing elit. Sed varius risus et leo bibendum
  10.       tempor. Pellentesque odio nulla, venenatis quis congue at,
  11.       ullamcorper sed est. ");
  12.  echo $oEmail->SendEmail();
  13.  // 1
  14.  ?>




Tags:

return:  true if mail could be send
since:  version 1.0
uses:  Strings()
uses:  CMNemailMessages::MakeHeaders()
uses:  STRemailAddresses()


Parameters:

object   $this->oTo_email   STRemailAddresses() object defining to email address (required)
object   $this->oTo_name   Strings() object defining to name
object   $this->oSubject   Strings() object defining subject
object   $this->oMessage   Strings() object defining message

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:02 +0200 by phpDocumentor 1.4.1