<?php
class m_Mail {
var $to;
var $subject;
var $content;
var $headers;
var $marker;
var $type;
var $xMailer = "xMailer";
function eMail($type = "1", $from, $replyto)
{
$this->type = $type;
$this->headers .= "From: " . $from . "\n";
$this->headers .= "Reply-to: " . $replyto . "\n";
$this->headers .= "X-Mailer: " . $this->xMailer . "\n";
$this->headers .= "MIME-Version: 1.0\n";
if ($type == 1) {
$this->headers .= "Content-Type: text/html; charset=utf-8\n";
} else {
$this->headers .= "Content-Type: multipart/mixed;\n";
$this->headers .= "\tboundary=\"___" . $this->marker . "==\"\n\n";
$this->content = "--___" . $this->marker . "==\n";
$this->content .= "Content-Type: text/html; charset=\"utf-8\"\n";
$this->content .= "Content-Transfer-Encoding: 8bit\n\n";
}
}
function eMailAttachment($mimeType, $fileName, $data)
{
if ($this->type != 1) {
$this->content .= "\n\n--___" . $this->marker . "==\n";
$this->content .= "Content-Type: " . $mimeType . "; name=\"" . $fileName . "\"\n";
$this->content .= "Content-Transfer-Encoding: base64\n";
$this->content .= "Content-Disposition: attachment; filename=\"" . $fileName . "\"\n\n";
}
}
function eMailSend($to)
{
if ($this->type != 1) {
$this->content .= "--___" . $this->marker . "==--\n\n"; // close marker
}
mail ($to, $this->subject, $this->content, $this->headers); }
function eMailContent($subject, $content)
{
$this->subject = $subject;
$this->content .= $content;
}
}
?>
To jest klasa, którą wysyłam maile. Może Ci pomoże.
Autor:
http://www.kocjan.net/publikacje.html?id=5edit:
chyba, że chodzi Ci o załączenie grafiki inline, bezpośrednio w wiadomości, a nie jako "załącznik" "załącznik".