Hi,
Ich hab da so ein Problem mit HTML-E-Mails, PHP und manchen Mail-Clients. Ich bin inzwischen am verzweifeln, weil es einfach nicht funktioniert…
Also ich nutze eine E-Mail-Klasse für Mails. Das Problem besteht (bisher) bei folgenden E-Mail-Clients:
[ul]
[li] Outlook[/li]
[li] Sparrowmail[/li][/ul]
In der Mail.app vom Mac und am iPhone und in der Webansicht funktioniert alles tadelos…
Ich setze auch alles auf HTML, ich weiß halt nicht woran es liegt… 
Hier mail der Code der Klasse:
[code]<?php
/**
*@package goma framework
*@link http://goma-cms.org
*@license: http://www.gnu.org/licenses/gpl-3.0.html see ‘license.txt’
*@Copyright © 2009 - 2012 Goma-Team
- last modified: 07.03.2012
*/
defined(‘IN_GOMA’) OR die(’’); // silence is golden 
class Mail extends Object
{
/**
* This var contains the email of the sender of the mail
*@name sendermail
*@access public
*@var string
**/
public $senderemail;
/**
* the name of the sender
*
*@name sendername
*@access public
*/
public $sendername;
/**
* This var defines if the message is html
*@name html
*@access public
*@var bool
**/
public $html;
/**
* This var defines if the message schould be replied
*@name reply
*@access public
*@var bool
**/
public $reply;
/**
* sets $addressor, $html, $reply
*@name __construct
*@param string - addressor
*@param bool - message format
*@param bool - reply
*@access public
*@return bool
**/
public function __construct($from = null, $html = true, $reply = true, $sendername = null)
{
parent::__construct();
/* --- */
if($from === null) {
$from = "noreply@" . $_SERVER["SERVER_NAME"];
}
if(!empty($from))
{
$this->senderemail = $from;
if($sendername === null)
$this->sendername = $from;
else
$this->sendername = $from;
}
$this->html = $html;
$this->reply = $reply;
return true;
}
/**
* sends a mail
*@name send
*@param string - adresse
*@param string - subject
*@param string - text
*@access public
*@return bool
**/
public function send($adresse, $subject, $message)
{
$header = "";
if(!empty($this->senderemail))
{
$header = "From: ".$this->sendername." <" . $this->senderemail . ">\n";
if($this->reply)
{
$header .= "Reply-To: ".$this->sendername." <" . $this->senderemail . ">\n";
}
}
if($this->html)
{
$header .= "Content-Type: text/html\n";
}
$header .= 'X-Mailer: Goma '.GOMA_VERSION.' - '.BUILD_VERSION.'';
//logging('mail('.var_export($adresse, true).', '.var_export($subject, true).', '.var_export($message, true).', '.var_export($header, true).')');
if(mail($adresse, $subject, $message, $header))
{
return true;
}
return false;
}
/**
* sends HTML with predefined template
*@name sendHTML
*@access public
*@param string - addresse
*@param string - subject
*@param string - message
*/
public function sendHTML($adresse,$subject,$message)
{
$template = new Template();
$template->assign("subject", $subject);
$template->assign("message", $message);
$text = $template->display('mail.html');
return $this->send($adresse,$subject, $text);
}
}[/code]
Vielen Dank schonmal!
Daniel
