Forum » Server-Side scripting » Mail na registratie
Berichten: 721
avatar
Offline Stuur privebericht
Hallo,

hieronder mijn code met een registratie formulier, zou iemand het aan kunnen passen dat de gene die aangemeld heeft een mailtje in zijn mailbox krijgt van, u bent succesvol aangemeld?

Alvast bedankt.
Mvg,
Sven

Code | Selecteer Alles
minimaliseren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php 
include('db_connect.php');
  if(isset(
$_POST['registreer'])){
  
     
$query "INSERT INTO vp_users (user_firstname, user_lastname, user_mail, user_pass) VALUES ('".$_POST['voornaam']."', '".$_POST['achternaam']."', '".$_POST['email']."', '".md5($_POST['wachtwoord'])."')";
    
$sql mysql_query($query)or die(mysql_error());
    echo 
'<div style="padding-top:30px; color:white; "><h2>Succesvol aangemeld!</h2>U bent succesvol aangemeld. <a style="#DF0101: white; font-weight: bold;" href="?pagina=login">Hier</a> kunt u inloggen.</div>';
     
  }
  else {
?>


<h1>Registreer</h1>
        
        <form method="post">
        
            
            <input type="text" class="text" name="voornaam"  value="Voornaam" />
            <input type="text" class="text" name="achternaam" value="Achternaam"  />
            <input type="text" class="text" name="email"  value="Email"  />
            <input type="password" class="text" name="wachtwoord" value="Wachtwoord"  />
            
            
            <input type="submit" class="submit" name="registreer" value="Registreer" />
            </form>
            <span class="clear"></span>
            
        
        
        
<?php
}
?>

27-01-2012 13:00
Dit topic is 138 keer bekeken door 34 verschillende leden
Reacties op: "Mail na registratie"
Vorige pagina 1 | 2
What else?
Berichten: 1180
avatar
Online Stuur privébericht
deze code had ik een tijdje terug gevonden; werkte voor mij ook naar hotmail, al vind ik hotmail sowieso minder met email afhandeling:

Code | Selecteer Alles
minimaliseren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
function send_mail($fromname$emailaddress$fromaddress$emailsubject$body$fileattach false) {

        
# Is the OS Windows or Mac or Linux
        
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) $eol="rn";
          elseif (
strtoupper(substr(PHP_OS,0,3)=='MAC')) $eol="r";
                else 
$eol="n";

        
$mime_boundary_1 md5(time());
        
$mime_boundary_2 "1_".$mime_boundary_1;
        
$mail_sent false;
 
        
# Common Headers
        
$headers "";
        
$headers .= 'From: '.$fromname.'<'.$fromaddress.'>'.$eol;
        
$headers .= 'Reply-To: '.$fromname.'<'.$fromaddress.'>'.$eol;
        
$headers .= 'Return-Path: '.$fromname.'<'.$fromaddress.'>'.$eol;        // these two to set reply address
        
$headers .= "Message-ID: <".$now."webmaster@".$_SERVER['SERVER_NAME'].">".$eol;
        
$headers .= "X-Mailer: PHP v".phpversion().$eol;                  // These two to help avoid spam-filters

        # Boundry for marking the split & Multitype Headers
        
$headers .= 'MIME-Version: 1.0'.$eol;
        
$headers .= "Content-Type: multipart/mixed;".$eol;
        
$headers .= "   boundary=\"".$mime_boundary_1."\"".$eol;
        
        
$msg  "";
        
        
# Building Message Body
        
$msg .= "--".$mime_boundary_1.$eol;
        
$msg .= "Content-Type: multipart/alternative;".$eol;
        
$msg .= "       boundary=\"".$mime_boundary_2."\"".$eol.$eol;
        
        
# Text Version
        
$msg .= "--".$mime_boundary_2.$eol;
        
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
        
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
        
$msg .= strip_tags(str_replace("<br>"$eol$body)).$eol.$eol;
 
        
# HTML Version
        
$msg .= "--".$mime_boundary_2.$eol;
        
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
        
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
        
$msg .= str_replace($eol"<br>"$body).$eol.$eol;
 
        
# Finished Message Body
        
$msg .= "--".$mime_boundary_2."--".$eol.$eol;
        
        
# Begin Adding Attachments
        
if ($fileattach) {
                for(
$i=0$i count($fileattach); $i++) {
                        if (
is_file($fileattach[$i]["file"])) { 
                                
# File for Attachment
                                
$file_name substr($fileattach[$i]["file"], (strrpos($fileattach[$i]["file"], "/")+1));
          
                                
$handle=fopen($fileattach[$i]["file"], 'rb');
                                
$f_contents=fread($handlefilesize($fileattach[$i]["file"]));
                                
$f_contents=chunk_split(base64_encode($f_contents));    //Encode The Data For Transition using base64_encode();
                                
                                //Remove file
                                
unlink($fileattach[$i]["file"]);
          
                                
# Attachment
                                
$msg .= "--".$mime_boundary_1.$eol;
                                
$msg .= "Content-Type: ".$fileattach[$i]["content_type"].";".$eol;
                                
$msg .= "       name=\"".$file_name."\"".$eol;
                                
$msg .= "Content-Transfer-Encoding: base64".$eol;
                                
$msg .= "Content-Disposition: attachment;".$eol;
                                
$msg .= "       filename=\"".$file_name."\"".$eol.$eol// !! This line needs TWO end of lines !! IMPORTANT !!
                                
                                
$msg .= $f_contents.$eol.$eol;
                        }
                }
        }
 
        
# Finished
        
$msg .= "--".$mime_boundary_1."--".$eol.$eol;  // finish with two eol's for better security. see Injection.
  
        # SEND THE EMAIL
        
ini_set(sendmail_from$fromaddress);  // the INI lines are to force the From Address to be used !
        
if (mail($emailaddress$emailsubject$msg$headers)) $mail_sent true;
        
ini_restore(sendmail_from);
        return 
$mail_sent;
}
27-01-2012 14:06
High Voltage
Berichten: 80
avatar
Offline Stuur privébericht
Dat is niet echt te veranderen, de ontvangende mailserver kijkt waar vandaan de mail wordt verstuurd en beslist aan de hand daarvan waar hij in terecht komt.
27-01-2012 14:06
Informatica Student
Berichten: 1406
avatar
Online Stuur privébericht
Google gebruiken is ook zo moeilijk tegenwoordig...
27-01-2012 14:56
Berichten: 721
avatar
Offline Stuur privébericht
Ergens niet uitkomen en google gebruikt hebben, toch zo moeilijk tegenwoordig.
27-01-2012 15:14
Reageer op: "Mail na registratie"
Vorige pagina 1 | 2
Je kan niet reageren omdat je niet bent ingelogd. Inloggen of Aanmelden