Toon posts:

[php]hoe deze HTML e-mail versturen.

Pagina: 1
Acties:
  • 56 views sinds 30-01-2008

Verwijderd

Topicstarter
héé! ik heb een stukje code die ik via mail wil gaan vesturen, ik weet alleen niet hoe! (Ja, ik weet hoe je een HTML e-mail met versturen! dat is het probleem ook niet!!!)

dit is de code die ik via mail wil gaan versturen:

PHP:
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
                    <table width=470 bgcolor=defdfe cellspacing=0 cellpadding=0 border=0> 
                    <tr> 
                        <td colspan=2><font class=header>BANK/GIRO</font></td> 
                        <td align=right bgcolor=2a89d6><font color=white size=1><b>Overschrijvingskaart</b></font></td> 
                    </tr> 
                    <tr> 
                        <td bgcolor=ffffff><font color=red size=1>Euro</font></td> 
                        <td align=center bgcolor=ffffff><font color=red size=1>Eurocent</font></td> 
                        <td><font color=black size=1>Betalingskenmerk</font></td> 
                    </tr> 
                    <tr valign=top> 
                        <td align=right bgcolor=ffffff><font color=red size=3>€</font> 
<? 
                        $totaal_prijs  = sprintf("%01.2f", $var["totaal_incl_korting"]); 
                        $voor_de_comma = substr($totaal_prijs, 0, -3); 
                        $na_de_comma   = substr($totaal_prijs, -2); 

                        $voor_de_comma = (string)$voor_de_comma; 
                        $na_de_comma   = (string)$na_de_comma; 

                        for ($i = strlen($voor_de_comma); $i <= 8; $i++) 
                            echo "[img]images/empty.gif[/img]"; 

                        for ($i = 0; $i < strlen($voor_de_comma); $i++) 
                        echo "[img]images/"[/img]"; 
?> 
                        </td> 
                        <td align=right bgcolor=ffffff> 
<? 
                        for ($i = 0; $i < strlen($na_de_comma); $i++) 
                        echo "[img]images/"[/img]"; 
?> 
                        [img]images/emptypixel.gif[/img] 
                        </td> 
                        <td> 
<? 
                        $klant_id = (string)$klant_id; 

                        for ($i = strlen($klant_id); $i <= 16; $i++) 
                            echo "[img]images/0.gif[/img]"; 

                        for ($i = 0; $i < strlen($klant_id); $i++) 
                        echo "[img]images/"[/img]"; 
?> 
                        </td> 
                    </td> 
                    <tr> 
                        <td colspan=2 bgcolor=ffffff><font color=red size=1>Naar bankrekening</font></td> 
                        <td><font color=black size=1>Mededelingen</font></td> 
                    </tr> 
                    <tr> 
                        <td colspan=2 align=right bgcolor=ffffff>[img]images/empty.gif[/img][img]images/empty.gif[/img][img]images/empty.gif[/img][img]images/empty.gif[/img][img]images/8.gif[/img][img]images/4.gif[/img][img]images/4.gif[/img][img]images/6.gif[/img][img]images/1.gif[/img][img]images/0.gif[/img][img]images/6.gif[/img] [img]images/emptypixel.gif[/img]</td> 
                        <td>[img]images/emptypixel.gif[/img]<font color=black size=2><? echo $klant_id; ?></font></td> 
                    </tr> 
                    <tr> 
                        <td colspan=2> 
                            <table border=0> 
                            <tr> 
                                <td><font color=black size=1>Ten name<br>van</font></td> 
                                <td><font color=black size=1><b>xxx</b></font></td> 
                            </tr> 
                            </table> 
                        </td> 
                        <td bgcolor=ffffff><font color=red size=1>Handtekening</font></td> 
                    </tr> 
                    <tr> 
                        <td colspan=2><font color=black size=1>Adres </font><font color=black size=2>xxx</font></td> 
                        <td valign=bottom background=images/rdot.gif bgColor=ffffff>&nbsp;</td> 
                    </tr> 
                    <tr> 
                        <td colspan=2> 
                            <table border=0> 
                            <tr> 
                                <td><font color=black size=1>Post-<br>code</font></td> 
                                <td valign=bottom bgcolor=ffffff>[img]images/1.gif[/img][img]images/1.gif[/img][img]images/1.gif[/img][img]images/1.gif[/img][img]images/a.gif[/img][img]images/a.gif[/img] 
                                <td><font color=black size=1>Plaats</font><font color=black size=2> xxx</font></td> 
                            </tr> 
                            </table> 
                        </td> 
                        <td valign=top> 
                            <table width="100%" cellspacing=0 cellpadding=0 border=0> 
                                <tr> 
                                    <td bgcolor=ffffff><font size=2>&nbsp;</font></td> 
                                </tr> 
                                <tr> 
                                    <td>&nbsp;</td> 
                                </tr> 
                            </table> 
                         </td> 
                    </tr> 
                    <tr> 
                        <td colspan=3> 
                            <table cellspacing=0 cellpadding=0 width="100%" border=0> 
                                <tr valign=top> 
                                    <td><font color=black size=1>Volgnummer</font></td> 
                                    <td align=right>&nbsp;</td> 
                                    <td align=right><font color=black size=1>Rekening</font></td> 
                                    <td>&nbsp;</td> 
                                </tr> 
                                <tr> 
                                    <td valign=top><font color=black size=1> 123</font></td> 
                                    <td><font color=black size=1><? echo $var["voornaam"] . " " . $var["achternaam"]; ?><br><? echo $var["straatnaam"] . " " . $var["huisnummer"]; ?><br><? echo $var["postcode_postbus"] . " " . $var["woonplaats"]; ?></font></td> 
                                    <td valign=top align=right><font color=black size=1> 1234567890</font></td> 
                                    <td valign=bottom align=right><font color=black size=1>Op witte onderzijde niet schrijven</font></td> 
                                </tr> 
                            </table> 
                        <tr> 
                        <td bgcolor=ffffff colspan=2><font color=black size=1>1234567890+ 1234567890&lt;</font></td> 
                        <td align=right bgColor=ffffff><font color=black size=1>12345678901234567890 + 12&gt;</font></td> 
                    </tr> 
                    </table> 
<?
$headers  = "MIME-Version: 1.0\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\n"; 
$headers .= "From: xxx <xxx@xxx.xx>\n"; 

mail ($email, $betreft, $body, $headers); 
?>

Nu was mijn idee om de inhoud één grote variable te maken, zo dus: $body = "<table width=470 bgcolor=defdfe cellspacing=0 bla bla.........";

maar dat kan of werkt niet omdat er allemaal PHP code ook in zit zoals loops enzo.... weet iemand een andere manier hoe ik dit netjes kan versturen via e-mail?

Gr. JorJor.

  • André
  • Registratie: Maart 2002
  • Laatst online: 19-08 12:30

André

Analytics dude

escapen?

  • Eelke Spaak
  • Registratie: Juni 2001
  • Laatst online: 16-08 19:14

Eelke Spaak

- Vlad -

Volgens mij bedoelt de TS dat 'ie wil dat de PHP-code in het bericht uitgevoerd wordt en dat de uitvoer in de mail komt te staan. Dat kan dus niet met escapen. (Als dat niet is wat je wil; negeer deze post :D )

Je moet een $body aanmaken, en dan alle echo-statements vervangen door een
PHP:
1
$body .= "[img]images/empty.gif[/img]";

TheStreme - Share anything with anyone


  • curry684
  • Registratie: Juni 2000
  • Laatst online: 13-08 16:46

curry684

left part of the evil twins

Wanneer ga je P&W FAQ - De "quickstart" nu eens lezen en toepassen?

Of wil je echt een ban? :/

Professionele website nodig?


Dit topic is gesloten.