phpbar.de logo

Mailinglisten-Archive

[php] HTML-Mail

[php] HTML-Mail

Christoph Rust phpmaillist at webmaster-rust.de
Mit Jun 16 08:47:15 CEST 2004


Dennis Sterzenbach wrote:

> wie versende ich denn diese mails? Bei mir funzt das nicht... *kopfkratz*

Schau dir am besten mal die doku an, beispiel aus der doku:

<?php
include('Mail.php');
include('Mail/mime.php');

$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
$file = '/home/richard/example.php';
$crlf = "\r\n";
$hdrs = array(
              'From'    => 'you at yourdomain.com',
              'Subject' => 'Test mime message'
              );

$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file, 'text/plain');

$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$mail->send('postmaster at localhost', $hdrs, $body);
?>


php::bar PHP Wiki   -   Listenarchive