dreamweaver_8
Neues Mitglied
Hallo 
wie kann ich es machen, das nach der Registrierung dem registrierten automatisch eine E-Mail geschikt wird?
Bis jetzt habe ich folgende Code's:
Ein PHP code zum E-Mail's senden:
PHP:
[php:1:008f99d626]<?php
/* Empfänger */
$empfaenger = array('Damir<[email protected]>');
/* Empfänger CC */
$empfaengerCC = array('Damir CC<[email protected]>');
/* Empfänger BCC */
$empfaengerBCC = array('Damir BCC<[email protected]>');
/* Absender */
$absender = 'Administrator SELFPHP<[email protected]>';
/* Rueckantwort */
$reply = 'Administrator SELFPHP<[email protected]>';
/* Betreff */
$subject = 'Info Mail von SELFPHP';
/* Nachricht */
$message = '<html>
<head>
<title>SELFPHP - Mail Beispiel</title>
</head>
<body>
<table width="214" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47">PHP5</td>
<td width="56"> </td>
<td width="99"> </td>
</tr>
<tr>
<td> </td>
<td>SELFPHP</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>www.selfphp.de</td>
</tr>
</table>
</body>
</html>
';
/* Baut Header der Mail zusammen */
$headers .= 'From:' . $absender . "\n";
$headers .= 'Reply-To:' . $reply . "\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'X-Sender-IP: ' . $REMOTE_ADDR . "\n";
$headers .= "Content-type: text/html\n";
// Extrahiere Emailadressen
$empfaengerString = implode(',', $empfaenger);
$empfaengerCCString = implode(',', $empfaengerCC);
$empfaengerBCCString = implode(',', $empfaengerBCC);
$headers .= 'Cc: ' . $empfaengerCCString . "\n";
$headers .= 'Bcc: ' . $empfaengerBCCString . "\n";
/* Verschicken der Mail */
mail($empfaengerString, $subject, $message, $headers);
?>[/php:1:008f99d626]
 
Und den Code für die Registrierung:
	
	
	
		
Natürlich sollte der Empfänger der E-Mail die adresse sein die im Textfeld mail angegeben ist...
Ich hoffe ihr verstehts
				
			wie kann ich es machen, das nach der Registrierung dem registrierten automatisch eine E-Mail geschikt wird?
Bis jetzt habe ich folgende Code's:
Ein PHP code zum E-Mail's senden:
PHP:
[php:1:008f99d626]<?php
/* Empfänger */
$empfaenger = array('Damir<[email protected]>');
/* Empfänger CC */
$empfaengerCC = array('Damir CC<[email protected]>');
/* Empfänger BCC */
$empfaengerBCC = array('Damir BCC<[email protected]>');
/* Absender */
$absender = 'Administrator SELFPHP<[email protected]>';
/* Rueckantwort */
$reply = 'Administrator SELFPHP<[email protected]>';
/* Betreff */
$subject = 'Info Mail von SELFPHP';
/* Nachricht */
$message = '<html>
<head>
<title>SELFPHP - Mail Beispiel</title>
</head>
<body>
<table width="214" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47">PHP5</td>
<td width="56"> </td>
<td width="99"> </td>
</tr>
<tr>
<td> </td>
<td>SELFPHP</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>www.selfphp.de</td>
</tr>
</table>
</body>
</html>
';
/* Baut Header der Mail zusammen */
$headers .= 'From:' . $absender . "\n";
$headers .= 'Reply-To:' . $reply . "\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'X-Sender-IP: ' . $REMOTE_ADDR . "\n";
$headers .= "Content-type: text/html\n";
// Extrahiere Emailadressen
$empfaengerString = implode(',', $empfaenger);
$empfaengerCCString = implode(',', $empfaengerCC);
$empfaengerBCCString = implode(',', $empfaengerBCC);
$headers .= 'Cc: ' . $empfaengerCCString . "\n";
$headers .= 'Bcc: ' . $empfaengerBCCString . "\n";
/* Verschicken der Mail */
mail($empfaengerString, $subject, $message, $headers);
?>[/php:1:008f99d626]
Und den Code für die Registrierung:
		Code:
	
	<?php require_once('../../Connections/mel90.php'); ?> 
<?php 
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{ 
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; 
  switch ($theType) { 
    case "text": 
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; 
      break;    
    case "long": 
    case "int": 
      $theValue = ($theValue != "") ? intval($theValue) : "NULL"; 
      break; 
    case "double": 
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; 
      break; 
    case "date": 
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; 
      break; 
    case "defined": 
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; 
      break; 
  } 
  return $theValue; 
} 
$editFormAction = $_SERVER['PHP_SELF']; 
if (isset($_SERVER['QUERY_STRING'])) { 
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); 
} 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { 
  $insertSQL = sprintf("INSERT INTO login (Name, mail, Benuzername, Passwort) VALUES (%s, %s, %s, %s)", 
                       GetSQLValueString($_POST['Name'], "text"), 
                       GetSQLValueString($_POST['mail'], "text"), 
                       GetSQLValueString($_POST['Benuzername'], "text"), 
                       GetSQLValueString($_POST['Passwort'], "text")); 
  mysql_select_db($database_mel90, $mel90); 
  $Result1 = mysql_query($insertSQL, $mel90) or die(mysql_error()); 
  $insertGoTo = "registrierung-ok.php"; 
  if (isset($_SERVER['QUERY_STRING'])) { 
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; 
    $insertGoTo .= $_SERVER['QUERY_STRING']; 
  } 
  header(sprintf("Location: %s", $insertGoTo)); 
} 
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Unbenanntes Dokument</title> 
<style type="text/css"> 
<!-- 
.Stil1 {font-family: Arial, Helvetica, sans-serif} 
#Layer1 { 
   position:absolute; 
   left:33px; 
   top:46px; 
   width:427px; 
   height:55px; 
   z-index:1; 
} 
--> 
</style> 
</head> 
<body> 
<div class="Stil1" id="Layer1"> 
  <div align="center">Registrierung  </div> 
</div> 
<table width="478" border="0" cellpadding="0" cellspacing="0"> 
   
  <tr> 
    <td width="478" height="332"><div align="left"> 
      <form id="form1" name="form1" method="post" action=""> 
        <label></label> 
        <label></label> 
 </p> 
      </form> 
      
      <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> 
        <table align="center"> 
          <tr valign="baseline"> 
            <td nowrap align="right">Name:</td> 
            <td><input type="text" name="Name" value="" size="32"></td> 
          </tr> 
          <tr valign="baseline"> 
            <td nowrap align="right">E-Mail:</td> 
            <td><input type="text" name="mail" value="" size="32"></td> 
          </tr> 
          <tr valign="baseline"> 
            <td nowrap align="right">Benuzername:</td> 
            <td><input type="text" name="Benuzername" value="" size="32"></td> 
          </tr> 
          <tr valign="baseline"> 
            <td nowrap align="right">Passwort:</td> 
            <td><input type="text" name="Passwort" value="" size="32"></td> 
          </tr> 
          <tr valign="baseline"> 
            <td nowrap align="right"> </td> 
            <td><input type="submit" value="Registrieren"></td> 
          </tr> 
        </table> 
        <input type="hidden" name="MM_insert" value="form2"> 
      </form> 
      
 </p> 
    </div> 
    
Wer sich mit falschem namen oder E-Mail adresse Registriert wird automatisch gelöscht!</p> 
    
Wer sich mehrmals registriert auch! </p></td> 
  </tr> 
</table> 
</body> 
</html>Natürlich sollte der Empfänger der E-Mail die adresse sein die im Textfeld mail angegeben ist...
Ich hoffe ihr verstehts
 
	