Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZMail Class Reference

## Public Member Functions
| __construct ( $id="")
| delete ( $id=-1)
| store ()
| removeContacts ( $mailID)
| addContact ( $mailID, $contactID, $companyEdit=true)
| get ( $id="")
| id ()
| to ()
| setTo ( $newTo)
| replyTo ()
| setReplyTo ( $newReplyTo)
| receiver ()
| setReceiver ( $newReceiver)
| from ()
| setFrom ( $newFrom)
| cc ()
| setCc ( $newCc)
| bcc ()
| setBcc ( $newBcc)
| messageID ()
| setMessageID ( $newMessageID)
| references ()
| setReferences ( $newReference)
| fromName ()
| setFromName ( $newFrom)
| sender ()
| setSender ( $newSender)
| subject ()
| setSubject ( $newSubject)
| body ()
| setBody ( $newBody)
| setBodyText ( $newBody)
| owner ()
| setOwner ( $newOwner)
| size ()
| siSize ()
| setSize ( $value)
| uDate ()
| setUDate ( $value)
| status ()
| setStatus ( $status, $directWrite=false)
| markAsDownloaded ()
| folder ( $as_object=true)
| getContacts ( $mailID=false)
| addFile ( $file)
| deleteFile ( $file)
| files ()
| addImage ( $image)
| deleteImage ( $image)
| images ()
& | copyMail ( $copyType="normal", $attachments=false)
| calculateSize ()
| send ()

## Static Public Member Functions
static & | splitList ( $emails)
static & | mergeList ( $emails)
static | validate ( $address)
static | stripEmail ( $address)
static | isDownloaded ( $mailident, $userID)
static | getByUser ( $user=false, $onlyUnread=false)
static | getByContact ( $ContactID, $CompanyEdit, $Offset, $Limit, $user=false)
static | isOwner ( $user, $mailID)
static | search ( $text, $user=-1)

## Public Attributes
| $parts
| this variable is only used during the buildup of a mail that is beeing sent. NEVER access directly!!! More...
| $To
| $From
| email adress More...
| $FromName
| users name More...
| $Cc
| $Bcc
| $MessageID
| used with the reference. More...
| $References
| used to thread mail, originally from News More...
| $ReplyTo
| $Subject
| $BodyText
| $Size
| $UDate
| $Status
| $FilesAttached
| $ID
| $UserID
| $IsPublished

## Private Member Functions
| add_attachment ( $message, $name="", $ctype="application/octet-stream", $encode='')
| build_message ( $part)
| build_multipart ()

## Detailed Description

Definition at line 56 of file ezmail.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMail::__construct | ( |  | $id = `""` | ) |

Constructs a new eZMail object.

If $id is set the object's values are fetched from the database.

Definition at line 64 of file ezmail.php.

References $id, and $ID.

## Member Function Documentation

## ◆ add_attachment()

eZMail::add_attachment | ( |  | $message,
|  |  | $name = `""`,
|  |  | $ctype = `"application/octet-stream"`,
|  |  | $encode = `''`
| ) |  |
| private

void add_attachment(string message, [string name], [string ctype]) Add an attachment to the mail object

Definition at line 1082 of file ezmail.php.

References $message, and $name.

Referenced by send().

## ◆ addContact()

eZMail::addContact | ( |  | $mailID,
|  |  | $contactID,
|  |  | $companyEdit = `true`
| ) |  |

Definition at line 179 of file ezmail.php.

References $db, $res, eZDB\finish(), and eZDB\globalDatabase().

## ◆ addFile()

eZMail::addFile | ( |  | $file | ) |

Definition at line 758 of file ezmail.php.

References $db, $file, calculateSize(), and eZDB\globalDatabase().

## ◆ addImage()

eZMail::addImage | ( |  | $image | ) |

Definition at line 816 of file ezmail.php.

References $db, $image, $res, eZDB\finish(), and eZDB\globalDatabase().

## ◆ bcc()

eZMail::bcc | ( |  | ) |

Returns a string containing all bcc adresses.

Definition at line 332 of file ezmail.php.

References $Bcc.

## ◆ body()

eZMail::body | ( |  | ) |

returns the body.

Definition at line 429 of file ezmail.php.

References $BodyText.

## ◆ build_message()

eZMail::build_message | ( |  | $part | ) |
| private

void build_message( array part ) Build message parts of an multipart mail

Definition at line 1098 of file ezmail.php.

References $message, and $part.

Referenced by build_multipart().

## ◆ build_multipart()

eZMail::build_multipart | ( |  | ) |
| private

void build_multipart() Build a multipart mail

Definition at line 1133 of file ezmail.php.

References $i, and build_message().

## ◆ calculateSize()

eZMail::calculateSize | ( |  | ) |

Calculates the size of the mail and its attachments.

Definition at line 945 of file ezmail.php.

References $file, $files, $size, and files().

Referenced by addFile(), and deleteFile().

## ◆ cc()

eZMail::cc | ( |  | ) |

Returns a string containing all cc adresses.

Definition at line 316 of file ezmail.php.

References $Cc.

## ◆ copyMail()

& eZMail::copyMail | ( |  | $copyType = `"normal"`,
|  |  | $attachments = `false`
| ) |  |

Returns a new eZMail object with all fields set according to the parameter. Valid values are: "reply", "replyall", "forward". If no parameter is given it just returns a copy of the mail. If $attachments is set to true also the attachments are copied. NOTE: The returned mail is not member of any folders. Set a folder for this mail or it will be LOST.

Definition at line 887 of file ezmail.php.

References $Bcc, $BodyText, $Cc, $From, $FromName, $ini, $MessageID, $References, $ReplyTo, $Subject, $To, $UserID, and files().

## ◆ delete()

eZMail::delete | ( |  | $id = `-1` | ) |

Deletes a eZMail object from the database.

Definition at line 87 of file ezmail.php.

References $db, $id, $ID, $res, eZDB\finish(), and eZDB\globalDatabase().

Referenced by eZMailFolder\deleteAll().

## ◆ deleteFile()

eZMail::deleteFile | ( |  | $file | ) |

Deletes an attachment from the mail. Recalculates the size of the mail.

Definition at line 779 of file ezmail.php.

References $db, $file, calculateSize(), and eZDB\globalDatabase().

## ◆ deleteImage()

eZMail::deleteImage | ( |  | $image | ) |

Deletes an eZImage attachment from the mail.

Definition at line 831 of file ezmail.php.

References $db, $image, $res, eZDB\finish(), and eZDB\globalDatabase().

## ◆ files()

eZMail::files | ( |  | ) |

Returns all attachments associatied with this mail.

Definition at line 794 of file ezmail.php.

References $db, $i, and eZDB\globalDatabase().

Referenced by calculateSize(), copyMail(), and send().

## ◆ folder()

eZMail::folder | ( |  | $as_object = `true` | ) |

Definition at line 660 of file ezmail.php.

References $db, $res, and eZDB\globalDatabase().

## ◆ from()

eZMail::from | ( |  | ) |

Returns the from address.

Definition at line 299 of file ezmail.php.

References $From.

## ◆ fromName()

eZMail::fromName | ( |  | ) |

Returns the from name.

Definition at line 381 of file ezmail.php.

References $FromName.

## ◆ get()

eZMail::get | ( |  | $id = `""` | ) |

Fetches the object information from the database.

Definition at line 200 of file ezmail.php.

References $db, $id, $mail_array, $ret, and eZDB\globalDatabase().

## ◆ getByContact()

static eZMail::getByContact | ( |  | $ContactID,
|  |  | $CompanyEdit,
|  |  | $Offset,
|  |  | $Limit,
|  |  | $user = `false`
| ) |  |
| static

Returns all mail that is sendt to a contact

Definition at line 711 of file ezmail.php.

References $CompanyEdit, $db, $field, $i, $mail, $res, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ getByUser()

static eZMail::getByUser | ( |  | $user = `false`,
|  |  | $onlyUnread = `false`
| ) |  |
| static

Returns all mail that belongs to this user as an array of eZMail objects.

Definition at line 681 of file ezmail.php.

References $db, $i, $query, $res, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ getContacts()

eZMail::getContacts | ( |  | $mailID = `false` | ) |

Definition at line 734 of file ezmail.php.

References $db, $ID, $res, and eZDB\globalDatabase().

## ◆ id()

eZMail::id | ( |  | ) |

Returns the object ID.

Definition at line 240 of file ezmail.php.

References $ID.

## ◆ images()

eZMail::images | ( |  | ) |

Returns all the images associated with this mail.

Definition at line 847 of file ezmail.php.

References $db, $i, and eZDB\globalDatabase().

## ◆ isDownloaded()

static eZMail::isDownloaded | ( |  | $mailident,
|  |  | $userID
| ) |  |
| static

Returns true if the mail with the given identification is allready downloaded for the given user. Note: this is the header ID we are talking about.

Definition at line 628 of file ezmail.php.

References $db, $res, $ret, and eZDB\globalDatabase().

Referenced by eZMailAccount\checkMail().

## ◆ isOwner()

static eZMail::isOwner | ( |  | $user,
|  |  | $mailID
| ) |  |
| static

Returns true if the given account belongs to the given user.

Definition at line 867 of file ezmail.php.

References $db, $res, $user, and eZDB\globalDatabase().

## ◆ markAsDownloaded()

eZMail::markAsDownloaded | ( |  | ) |

Marks this mail in the downloaded database.

Definition at line 643 of file ezmail.php.

References $db, $result, and eZDB\globalDatabase().

## ◆ mergeList()

static& eZMail::mergeList | ( |  | $emails | ) |
| static

Merges an array of email addresses into a list of email addresses.

Definition at line 585 of file ezmail.php.

References $emails.

## ◆ messageID()

eZMail::messageID | ( |  | ) |

Returns the message ID format : <number@serverID> Read in the RFC's if you want to know more about it..

Definition at line 349 of file ezmail.php.

References $MessageID.

## ◆ owner()

eZMail::owner | ( |  | ) |

Returns the userID of the user that owns this object

Definition at line 454 of file ezmail.php.

References $UserID.

## ◆ receiver()

eZMail::receiver | ( |  | ) |

Returns the receiver address. Wrapper function

Definition at line 282 of file ezmail.php.

References $To.

## ◆ references()

eZMail::references | ( |  | ) |

Returns the messageID that this message is a reply to.

Definition at line 365 of file ezmail.php.

References $References.

## ◆ removeContacts()

eZMail::removeContacts | ( |  | $mailID | ) |

Definition at line 171 of file ezmail.php.

References $db, $res, eZDB\finish(), and eZDB\globalDatabase().

## ◆ replyTo()

eZMail::replyTo | ( |  | ) |

Returns the receiver address.

Definition at line 265 of file ezmail.php.

References $ReplyTo.

## ◆ search()

static eZMail::search | ( |  | $text,
|  |  | $user = `-1`
| ) |  |
| static

returns every mail that is containing the search string

Definition at line 1150 of file ezmail.php.

References $db, $id, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ send()

eZMail::send | ( |  | ) |

Sends the mail with the values specified.

Definition at line 967 of file ezmail.php.

References $BodyText, $file, $files, $From, $suffix, add_attachment(), files(), eZPBFile\filesize(), and eZPBFile\fopen().

## ◆ sender()

eZMail::sender | ( |  | ) |

Returns the sender address.

Definition at line 397 of file ezmail.php.

References $From.

## ◆ setBcc()

eZMail::setBcc | ( |  | $newBcc | ) |

Sets the bcc addresses. Use , separating (; and : and " " should also work )

Definition at line 340 of file ezmail.php.

## ◆ setBody()

eZMail::setBody | ( |  | $newBody | ) |

Sets the body.

Definition at line 437 of file ezmail.php.

## ◆ setBodyText()

eZMail::setBodyText | ( |  | $newBody | ) |

Sets the body.

Definition at line 446 of file ezmail.php.

## ◆ setCc()

eZMail::setCc | ( |  | $newCc | ) |

Sets the cc addresses. Use , separating (; and : and " " should also work )

Definition at line 324 of file ezmail.php.

## ◆ setFrom()

eZMail::setFrom | ( |  | $newFrom | ) |

Sets the from address.

Definition at line 308 of file ezmail.php.

## ◆ setFromName()

eZMail::setFromName | ( |  | $newFrom | ) |

Sets the from name.

Definition at line 389 of file ezmail.php.

## ◆ setMessageID()

eZMail::setMessageID | ( |  | $newMessageID | ) |

Sets the message ID. This is a server setting only so BE CAREFULL WITH THIS.

Definition at line 357 of file ezmail.php.

## ◆ setOwner()

eZMail::setOwner | ( |  | $newOwner | ) |

Sets the owner of this mail

Definition at line 462 of file ezmail.php.

## ◆ setReceiver()

eZMail::setReceiver | ( |  | $newReceiver | ) |

Sets the receiver address. Wrapper function

Definition at line 290 of file ezmail.php.

## ◆ setReferences()

eZMail::setReferences | ( |  | $newReference | ) |

Sets the messageID that this message is a reply to.

Definition at line 373 of file ezmail.php.

## ◆ setReplyTo()

eZMail::setReplyTo | ( |  | $newReplyTo | ) |

Sets the receiver address.

Definition at line 273 of file ezmail.php.

## ◆ setSender()

eZMail::setSender | ( |  | $newSender | ) |

Sets the sender address.

Definition at line 405 of file ezmail.php.

## ◆ setSize()

eZMail::setSize | ( |  | $value | ) |

Returns the size of this mail in bytes.

Definition at line 519 of file ezmail.php.

## ◆ setStatus()

eZMail::setStatus | ( |  | $status,
|  |  | $directWrite = `false`
| ) |  |

Sets the status of this mail. 0 - UNREAD 1 - READ 2 - REPLIED 3 - FORWARDED 4 - MAIL_SENT If direct write is set the data will be written directly to the database. No need for calling store() afterwords. In order to do this you must be sure that the object is allready in the database.

Definition at line 563 of file ezmail.php.

References $db, $status, and eZDB\globalDatabase().

## ◆ setSubject()

eZMail::setSubject | ( |  | $newSubject | ) |

Sets the subject of the mail.

Definition at line 421 of file ezmail.php.

## ◆ setTo()

eZMail::setTo | ( |  | $newTo | ) |

Sets the receiver address.

Definition at line 256 of file ezmail.php.

## ◆ setUDate()

eZMail::setUDate | ( |  | $value | ) |

Sets the date of this mail in unix date time format.

Definition at line 535 of file ezmail.php.

## ◆ siSize()

eZMail::siSize | ( |  | ) |

Returns the size of this object in a human readable fasion. An array is returned with entries: "size" - original size "size-string" short size "unit" GB, MB, KB or B

Definition at line 486 of file ezmail.php.

References $size, and $Size.

## ◆ size()

eZMail::size | ( |  | ) |

Returns the size of this mail in bytes.

Definition at line 474 of file ezmail.php.

References $Size.

## ◆ splitList()

static& eZMail::splitList | ( |  | $emails | ) |
| static

Splits a list of email addresses into an array where each entry is an email address.

Definition at line 575 of file ezmail.php.

References $emails.

## ◆ status()

eZMail::status | ( |  | ) |

Definition at line 548 of file ezmail.php.

References $Status.

## ◆ store()

eZMail::store | ( |  | ) |

Stores a mail to the database.

Definition at line 105 of file ezmail.php.

References $db, $result, and eZDB\globalDatabase().

## ◆ stripEmail()

static eZMail::stripEmail | ( |  | $address | ) |
| static

Static function for extracting an e-mail from text

Returns the first valid e-mail in address, returns false if no e-mail addresses found

Definition at line 612 of file ezmail.php.

References $address, and $res.

## ◆ subject()

eZMail::subject | ( |  | ) |

Returns the subject.

Definition at line 413 of file ezmail.php.

References $Subject.

## ◆ to()

eZMail::to | ( |  | ) |

Returns the receiver address.

Definition at line 248 of file ezmail.php.

References $To.

## ◆ uDate()

eZMail::uDate | ( |  | ) |

Returns the date of this mail in unix date format.

Definition at line 527 of file ezmail.php.

References $UDate.

## ◆ validate()

static eZMail::validate | ( |  | $address | ) |
| static

Static function for validating e-mail addresses.

Returns true if successful, false if not.

Definition at line 599 of file ezmail.php.

References $address.

Referenced by eZBug\setUserEmail(), and eZFormRenderer\verifyForm().

## Member Data Documentation

## ◆ $Bcc

eZMail::$Bcc

Definition at line 1182 of file ezmail.php.

Referenced by bcc(), and copyMail().

## ◆ $BodyText

eZMail::$BodyText

Definition at line 1190 of file ezmail.php.

Referenced by body(), copyMail(), and send().

## ◆ $Cc

eZMail::$Cc

Definition at line 1181 of file ezmail.php.

Referenced by cc(), and copyMail().

## ◆ $FilesAttached

eZMail::$FilesAttached

Definition at line 1198 of file ezmail.php.

## ◆ $From

eZMail::$From

email adress

Definition at line 1178 of file ezmail.php.

Referenced by copyMail(), from(), send(), and sender().

## ◆ $FromName

eZMail::$FromName

users name

Definition at line 1180 of file ezmail.php.

Referenced by copyMail(), and fromName().

## ◆ $ID

eZMail::$ID

Definition at line 1201 of file ezmail.php.

Referenced by __construct(), delete(), getContacts(), and id().

## ◆ $IsPublished

eZMail::$IsPublished

Definition at line 1204 of file ezmail.php.

## ◆ $MessageID

eZMail::$MessageID

used with the reference.

Definition at line 1184 of file ezmail.php.

Referenced by copyMail(), and messageID().

## ◆ $parts

eZMail::$parts

this variable is only used during the buildup of a mail that is beeing sent. NEVER access directly!!!

Definition at line 1173 of file ezmail.php.

## ◆ $References

eZMail::$References

used to thread mail, originally from News

Definition at line 1186 of file ezmail.php.

Referenced by copyMail(), and references().

## ◆ $ReplyTo

eZMail::$ReplyTo

Definition at line 1187 of file ezmail.php.

Referenced by copyMail(), and replyTo().

## ◆ $Size

eZMail::$Size

Definition at line 1192 of file ezmail.php.

Referenced by siSize(), and size().

## ◆ $Status

eZMail::$Status

Definition at line 1195 of file ezmail.php.

Referenced by status().

## ◆ $Subject

eZMail::$Subject

Definition at line 1189 of file ezmail.php.

Referenced by copyMail(), and subject().

## ◆ $To

eZMail::$To

Definition at line 1176 of file ezmail.php.

Referenced by copyMail(), receiver(), and to().

## ◆ $UDate

eZMail::$UDate

Definition at line 1193 of file ezmail.php.

Referenced by uDate().

## ◆ $UserID

eZMail::$UserID

Definition at line 1202 of file ezmail.php.

Referenced by copyMail(), and owner().

The documentation for this class was generated from the following file:

- ezmail.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.