Email DarstellungsProblem GMX

Fragen zu allen Themen rund ums Programmieren außerhalb von phpBB können hier gestellt werden - auch zu anderen Programmiersprachen oder Software wie Webservern und Editoren.
Antworten
Benutzeravatar
Borstenhorst
Mitglied
Beiträge: 146
Registriert: 19.01.2004 18:37
Wohnort: Oberursel
Kontaktdaten:

Email DarstellungsProblem GMX

Beitrag von Borstenhorst »

Hi,
habe folgendes Problem, habe ein Mail-Script gecodet das html mails verschickt, klappt auch alles wunderbar nur aus irgend einem Grund können GMX Mailbox-Besitzer sich die mails nicht angucken, hier mal mein Quelltext und die Mail wie sie bei gmx ankommt:

Code: Alles auswählen

	$_POST[text]=str_replace("\n","<br>",$_POST[text]);
	
	$newslettersql=mysql_query("SELECT * FROM `bewerber` WHERE `newsletter` = 1");
	while($newsletter=mysql_fetch_array($newslettersql))
		{
		$empfaengername="$newsletter[name] $newsletter[vorname]";
		$empfaengermail="$newsletter[email]";
		$empfaenger="$empfaengername <$empfaengermail>";
		
		
		$absendername="XXXXXXX";
		$absendermail="xxx@xxxxxx.de";
		
//Sendemodul
$betreffzeile="$_POST[betreff]";
$nachricht="
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
<html xmlns=http://www.w3.org/1999/xhtml xml:lang=en>
<head>
  <meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 />
<style>
a, a:visited { color:#0860A8; text-decoration:none; }
a:hover { color:#0860A8; text-decoration:underline; }
	
.normal		{ font-family:verdana, sans-serif; color:#7F7E7E; font-size:10px; letter-spacing: -1px; }
a.normal		{ text-decoration: none;  }
a.normal:hover{ color : #7F7E7E; text-decoration:underline;}
a.normal:link   {  color : #7F7E7E; }
a.normal:visited{ color : #7F7E7E; }
</style></head><body>
<span class=normal>	
$_POST[text]
</span>	
</body></html>		
";

// Header
$header  = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$header .= 'From:' . "$absendername <$_POSTabsendermail> \r\n";

// Versand
mail($empfaenger, $betreffzeile, $nachricht, $header);	

Code: Alles auswählen

From - Tue Aug 29 01:54:27 2006
X-Account-Key: account5
X-UIDL: ed91dddb535a2bd37db4eca925871fe4
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: <wwwrun@xx.xxxxxxxx.de>
X-Flags: 0000
Delivered-To: GMX delivery to xxxxxx@gmx.de
Received: (qmail invoked by alias); 28 Aug 2006 23:54:16 -0000
Received: from xxxxxx.xxxxxxx.com (EHLO xxxxx.xxxx.com) [xx.13.135.xxx]
  by mx0.gmx.net (mx079) with SMTP; 29 Aug 2006 01:54:16 +0200
Received: by xxxxxx.xxxxxx.com (Postfix, from userid 30)
	id 3375D6CD55; Tue, 29 Aug 2006 01:54:16 +0200 (CEST)
To: testmail html <xxxxx@gmx.de>
Subject: Testmail alle gmx
MIME-Version: 1.0
Date: Tue, 29 Aug 2006 01:54:17 +0200
Message-ID: <20060828235417.7323gmx1@mx079.gmx.net>
X-GMX-Antivirus: -1 (not scanned, may not use virus scanner)
X-GMX-Antispam: 0 (Mail was not recognized as spam)
X-GMX-UID: HrTAcBpUTXs97oY9gGQ5MEBKRzdyMoM7

Content-type: text/html; charset=iso-8859-1

From:xxxxx <xxx@xxxxxx.de> 

Message-Id: <20060828235416.3375D6CD55@xxxxx.xxxxx.com>
Date: Tue, 29 Aug 2006 01:54:16 +0200 (CEST)



<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
<html xmlns=http://www.w3.org/1999/xhtml xml:lang=en>
<head>
  <meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 />
<style>
a, a:visited { color:#0860A8; text-decoration:none; }
a:hover { color:#0860A8; text-decoration:underline; }
	
.normal		{ font-family:verdana, sans-serif; color:#7F7E7E; font-size:10px; letter-spacing: -1px; }
a.normal		{ text-decoration: none;  }
a.normal:hover{ color : #7F7E7E; text-decoration:underline;}
a.normal:link   {  color : #7F7E7E; }
a.normal:visited{ color : #7F7E7E; }
</style></head><body>
<span class=normal>	

</span>	
</body></html>		


Habe alles was bissl intern ist durch xxxxx ersetzt ;)
Jensemann
Ehemaliges Teammitglied
Beiträge: 2549
Registriert: 25.02.2002 01:00

Beitrag von Jensemann »

Zum einen fehlt ein Leerzeichen nach dem "From:", zum anderen irritiert mich das Ergebniss, also die Mail selbst ziemlich:

Date und Message-ID sind doppelt. Ausserdem die ganzen Leerzeilen im Header, die gehören da nicht hin - was evtl. auch das Problem erklären könnte. Header und Body werden durch eine Leerzeile seperiert, bei der Mail unten kann der Mail-Client aber Header und Body nicht mehr auseinanderhalten.
Benutzeravatar
Borstenhorst
Mitglied
Beiträge: 146
Registriert: 19.01.2004 18:37
Wohnort: Oberursel
Kontaktdaten:

Beitrag von Borstenhorst »

Wenn ich dich also richtig verstanden habe mit dem "Nach From: "
sollte das jetzt so richtig sein:

Code: Alles auswählen

$header .= 'From: ' . "$_POST[absendername] <$_POST[absendermail]> \r\n";

Also so sieht eine Mail aus die den Transport überlebt

Code: Alles auswählen

From - Tue Aug 29 02:11:19 2006
X-Account-Key: account6
X-UIDL: AMoxvs4AARfFRPOCKQvwGHjEvQQ
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Apparently-To: xxxxxxxxx@xxxxxx.de via 206.190.49.202; Mon, 28 Aug 2006 16:54:17 -0700
X-Originating-IP: [85.13.135.131]
Authentication-Results: mta323.mail.re4.yahoo.com
  from=xxxxx.de; domainkeys=neutral (no sig)
Received: from xx.13.xxx.131  (EHLO xxxxx.xxxxxx.com) (85.13.135.131)
  by mta323.mail.re4.yahoo.com with SMTP; Mon, 28 Aug 2006 16:54:17 -0700
Received: by xxxxxx.xxxxxx.com (Postfix, from userid 30)
	id 586D672CB9; Tue, 29 Aug 2006 01:54:16 +0200 (CEST)
To: Test html2 <xxxxxxx@yahoo.de>
Subject: Testmail alle gmx
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From:xxxxx<xxxx@xxxxxxxx.de> 
Message-Id: <20060828235416.586D672CB9@xxxxxx.xxxxxx.com>
Date: Tue, 29 Aug 2006 01:54:16 +0200 (CEST)



<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
<html xmlns=http://www.w3.org/1999/xhtml xml:lang=en>
<head>
  <meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 />
<style>
a, a:visited { color:#0860A8; text-decoration:none; }
a:hover { color:#0860A8; text-decoration:underline; }
	
.normal		{ font-family:verdana, sans-serif; color:#7F7E7E; font-size:10px; letter-spacing: -1px; }
a.normal		{ text-decoration: none;  }
a.normal:hover{ color : #7F7E7E; text-decoration:underline;}
a.normal:link   {  color : #7F7E7E; }
a.normal:visited{ color : #7F7E7E; }
</style></head><body>
<span class=normal>	

</span>	
</body></html>		


Antworten

Zurück zu „Coding & Technik“