---
title: "skicka mejl"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/69111-skicka-mejl"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "benken"
published: "2003-02-23T11:34:23.000Z"
updated: "2003-02-23T14:38:11.000Z"
replies: 3
views: 231
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/69111-skicka-mejl"
---

# skicka mejl

## #1 — benken, 2003-02-23T11:34Z

Jag vill kunna skicka en sida som mejl, sidan heter mail.php?uid=3245, hur gör jag detta?

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

## #2 — pimme, 2003-02-23T13:29Z

kolla upp funktionen mail() i manualen

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

## #3 — benken, 2003-02-23T13:59Z

Kolla här, 

```
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$mailheaders = "From: Henrik<> \n";
$mailheaders .= "Reply-To: [email]Henrik@geekplanet.net[/email]\n\n";

mail("h@mail.kom", "Hej!", $här vill jag ha in mail.php exekverad, $mailheaders) or die("Fel...");
```

Hur görs det?

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

## #4 — stevenet, 2003-02-23T14:38Z

```php
<?
// funktion hämtad från kommentar i manualen
function evalHTML ( $string ) {
   $pos = 0;
   $start = 0;

   /* Loop through to find the php code in html...  */
  while ( ($pos = strpos( $string, '<?php', $start )) != FALSE ) {
      /* Find the end of the php code.. */
       $pos2 = strpos( $string, "?>", $pos + 5);

       /* Eval outputs directly to the buffer. Catch / Clean it */ 
       ob_start();
     eval( substr( $string, $pos + 5, $pos2 - $pos - 5) );
      $value = ob_get_contents();
       ob_end_clean();

       /* Grab that chunk!  */
       $start = $pos + strlen($value);
      $string = substr( $string, 0, $pos ) . $value . substr( $string,
$pos2 + 2);
       }

   return $string;
}

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$mailheaders = "From: Henrik<> \n";
$mailheaders .= "Reply-To: [email]Henrik@geekplanet.net[/email]\n\n";
$innehall=implode ('', file ('http://x.se/mail.php?uid=3245'));
$filen=evalHTML($innehall);
mail("h@mail.kom", "Hej!", $filen, $mailheaders) or die("Fel...");
?>
```

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

---

Tråden på webben: https://www.webforum.nu/amne/php/69111-skicka-mejl
