webForumDet fria alternativet

skicka mejl

3 svar · 227 visningar · startad av benken

benkenMedlem sedan feb. 2003250 inlägg
#1

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

pimmeMedlem sedan sep. 20011 086 inlägg
#2

kolla upp funktionen mail() i manualen

benkenMedlem sedan feb. 2003250 inlägg
#3

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?

stevenetMedlem sedan juni 20001 251 inlägg
#4
<?
// 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...");
?>
128 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
126 ms — hämta tråd, inlägg och bilagor (db)