Hier die wichtigsten daten:
Setzung:
Konstanten & Vars:
Das ganze ist in einer Klasse aufgabaut alles zu posten hätte mindestens 10 bildschirm seiten verschlungen...
Code:
<?php
public function send()
{
$header = '';
$header .= 'Date: '.$this->date."\r\n";
$header .= 'From: '.$this->from."\r\n";
$header .= 'Reply-To: '.$this->reply_to."\r\n";
if($this->cc != '')
$header .= 'Cc: '.$this->cc."\r\n";
if($this->bcc != '')
$header .= 'Bcc: '.$this->bcc."\r\n";
$header .= 'Message-ID: '.$this->message_id."\r\n";
$header .= 'In-Reply-To: '.$this->in_reply_to."\r\n";
$header .= 'References: '.$this->references."\r\n";
if($this->comments != '')
$header .= 'Comments: '.$this->comments."\r\n";
if($this->keywords != '')
$header .= 'Keywords: '.$this->keywords."\r\n";
$header .= 'Return-Path: '.$this->return_path."\r\n";
$header .= 'Mime-Version: '.$this->mime_version."\r\n";
$header .= 'Content-Type: '.$this->content_type."\r\n";
$header .= 'Content-Transfer-Encoding: '.$this->content_transfer_encoding."\r\n";
if($this->content_description != '')
$header .= 'Content-Description: '.$this->content_description."\r\n";
foreach($this->header as $key => $value)
$header .= $key.': '.$value."\r\n";
$mail = mail($this->to , $this->subject, preg_replace("/\n|\r/", "\r\n", $this->message), $header);
}
?>
Setzung:
Code:
<?php
$this->error = '';
$this->setDate(date('Y-m-d H:i:s'));
$this->setFrom($from_email, $from_name);
$this->setReplyTo($from_email, $from_name);
$this->setTo($to_email, $to_name);
$this->setCc('');
$this->setBcc('');
$this->setMessageID(MAIL_HEADER_STANDARD_MESSAGE_ID_NAME);
$this->setInReplyTo();
$this->setReferences();
$this->setSubject($subject);
$this->setKeywords();
$this->setReturnPath($from_email);
$this->setMessage($message);
$this->setMimeVersion(MAIL_HEADER_STANDARD_MIME_VERSION);
$this->setContentType(MAIL_HEADER_STANDARD_MIME_TYPE, MAIL_HEADER_STANDARD_CHARSET);
$this->setContentTransferEncoding(MAIL_HEADER_STANDARD_CONTENT_TRANSFER_ENCODING);
$this->setContentDescription(MAIL_HEADER_STANDARD_CONTENT_DESCRIPTION);
?>
Konstanten & Vars:
Code:
<?php
define('MAIL_HEADER_STANDARD_MESSAGE_ID_NAME' , 'formmailer');
define('MAIL_HEADER_STANDARD_MIME_VERSION' , '1.0');
define('MAIL_HEADER_STANDARD_MIME_TYPE' , 'text/plain');
define('MAIL_HEADER_STANDARD_CHARSET' , 'iso-8859-1');
define('MAIL_HEADER_STANDARD_CONTENT_TRANSFER_ENCODING' , '8bit');
define('MAIL_HEADER_STANDARD_CONTENT_DESCRIPTION' , '');
$from_name = 'Prophet';
$from_email = 'prophet@localhost';
$to_name = 'Test';
$to_email = '[email protected]';
$subject = 'testmail';
$message = 'Hallo funktioniert der PHP Mailer?';
?>
Das ganze ist in einer Klasse aufgabaut alles zu posten hätte mindestens 10 bildschirm seiten verschlungen...