---
title: "RFC 2822 kompatibel formmail"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/192030-rfc-2822-kompatibel-formmail"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "maweer"
published: "2014-03-07T10:28:39.000Z"
updated: "2014-03-07T17:34:45.000Z"
replies: 3
views: 849
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/192030-rfc-2822-kompatibel-formmail"
---

# RFC 2822 kompatibel formmail

## #1 — maweer, 2014-03-07T10:28Z

Hejsan!

Går det att göra något åt denna koden så att den blir RFC 2822 och RFC 5322 kompatibel. Vore jätte tacksam för hjälp, då jag inte fattar ett skvatt om vad som skall göras :)

```php
$to = "<mail_1@blabla.com>, <mail_2@blabla.com>, <mail_3@blabla.com>, <mail_4@blabla.com>, <mail_5@blabla.com>, <mail_6@blabla.com>";
$subject = $_POST['plats'] . ' ' . $_POST['datum'] . ': Ny Spelning - Sidan uppdaterad';
$message1="Ny spelning: $_POST[plats], $_POST[datum]<br>http://xxxxxxxxxx.se/xxxxxx/form.php<p><u>Kan du?</u><br>Sätt en bock i kryssrutan och tryck på Spara<p><u>Kan du inte?</u><br>Tryck på ditt namn, så att det blir rött";
$from = "postmaster@xxxxxxxxxx.se";
$headers .= "Reply-To: $visitor_email \r\n";
$headers = "From:" . $from;

$headers  = "MIME-Version: 1.0\r\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers .= "From: Mitt Namn <$from>\r\n";
$headers .= "From:" . $from; 

     
     
$header1 ="<html>\r\n"; 
$header1 .="<head>\r\n"; 
$header1 .="<title>".$subject."</title>\r\n"; 
$header1 .="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n"; 
$header1 .="</head>\r\n"; 
$header1 .="<body class=\"body\">\r\n"; 
 

$footer1 = "<p><font face='Tahoma' size='3'><b>Eva and the Adams</b><br><font face='Tahoma' size='2'>Texten till footer<br><i><a href='http://xxxxxxx.info/'>www.xxxxxxx.info</a></i></p>"; 
$footer1 .= "</body></html>"; 

$text = strip_tags($_POST['text']); 
$text = eregi_replace("\r\n", "<br>", $_POST['text'] ); 

$message = $header1; 
$message .= $message1; 
$message .= $footer1; 

mail($to, $subject, $message, $headers);
```

Permalänk: https://www.webforum.nu/p/192030

## #2 — grennfox, 2014-03-07T16:46Z

Kanske är helt ute och cyklar nu, men kan du inte byta ut:

```php
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
```

till

```php
$headers .= "Content-type: text/html; charset=rfc-2822\r\n";
```

Kanske tänker fel men tycker att det borde fungera då :P

Permalänk: https://www.webforum.nu/p/2315661

## #3 — maweer, 2014-03-07T17:25Z

Tyvärr, det blev samma elände ;)

```
<mail1@gmail.com>: host gmail-smtp-in.l.google.com said:
Our system has detected that this message RFC 2822 compliant. To reduce the amount of spam sent to Gmai this message has been blocked. Please review RFC 2822 specifications for more information. 46si17671041eem.235 - gsmtp (in reply to end of DATA command)

<mail2@hotmail.com>: host mx2.hotmail.com said: (COL0-MC5-F3) Message could not be delivered. Please ensure the message is RFC 5322 compliant. (in reply to end of DATA command)

<mail3@xxxxxxxx.se>: host mail1.xxxxxxxxx.se said: Missing purported responsible address (in reply to end of DATA command)
```

Permalänk: https://www.webforum.nu/p/2315664

## #4 — maweer, 2014-03-07T17:34Z

Jag tror minsann jag kom på det själv :)

Jag hade råkat få tre stycken

```php
$headers = "From:" . $from;
```

Tack för att du tog dig tid grennfox

Permalänk: https://www.webforum.nu/p/2315665

---

Tråden på webben: https://www.webforum.nu/amne/php/192030-rfc-2822-kompatibel-formmail
