A very, very simple mail class! So simple that doesn't justify its use anyway... it can be a open-eyes for those who want to start working with classes!
// Constructs a minimail object.
function minimail($to, $subject, $message, $from){
// Creates message.
// Adds a "To" address.
$this->data['to'] = $to;
// Adds a "Subject" line.
$this->data['subject'] = $subject;
// Adds a "body" line.
$this->data['message'] = $message;
// Adds a "From" address.
$this->data['from'] = $from;
// Call send() function.
$this->send();
}
// Sends mail using the mail program.
// Return true, otherwise call mail_error()!
function send(){
$mail = @mail($this->data['to'], $this->data['subject'], $this->data['message'], 'From: '.$this->data['from']);