een link klikbaar maken in activatie mail
Ik heb een inlogscipt. Deze werkt goed, echter heb ik een klein probleempje met de activatiemail. De activatiemail krijg ik altijd keurig in de mail, maar de link is niet klikbaar. De link moet eerst gekopieerd worden in de adresbalk, maar volgens mij moet het ook anders kunnen. Alleen weet ik niet hoe....
Onderstaand de code waar het bij hoort:
Code (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
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
<?php
// getting ready to send the email
require_once($this->mail_phpmailer);
$mail = new PHPMailer();
$mail->CharSet = $this->mail_CharSet;
$mail->From = $this->mail_From;
$mail->FromName = $this->mail_FromName;
$mail->Subject = $this->mail_LostPassSubject;
$body = file_get_contents($this->mail_LostPassEmailTemplate);
$body_plain = file_get_contents($this->mail_LostPassEmailTemplatePlain);
$mainUrl = str_replace("ajax/forgottenPassword.php", "", "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
$body = str_replace("[VERIFICATION_URL]", $mainUrl."index.php?uid=".$line['Id']."&auth_code=".$code, $body);
$body_plain = str_replace("[VERIFICATION_URL]", $mainUrl."index.php?uid=".$line['Id']."&auth_code=".$code, $body_plain);
$mail->MsgHTML($body);
$mail->AltBody = $body_plain;
$mail->AddAddress($email);
$mail->Send();
$mail->ClearAddresses();
return '1';
}
return '0';
}
?>
// getting ready to send the email
require_once($this->mail_phpmailer);
$mail = new PHPMailer();
$mail->CharSet = $this->mail_CharSet;
$mail->From = $this->mail_From;
$mail->FromName = $this->mail_FromName;
$mail->Subject = $this->mail_LostPassSubject;
$body = file_get_contents($this->mail_LostPassEmailTemplate);
$body_plain = file_get_contents($this->mail_LostPassEmailTemplatePlain);
$mainUrl = str_replace("ajax/forgottenPassword.php", "", "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
$body = str_replace("[VERIFICATION_URL]", $mainUrl."index.php?uid=".$line['Id']."&auth_code=".$code, $body);
$body_plain = str_replace("[VERIFICATION_URL]", $mainUrl."index.php?uid=".$line['Id']."&auth_code=".$code, $body_plain);
$mail->MsgHTML($body);
$mail->AltBody = $body_plain;
$mail->AddAddress($email);
$mail->Send();
$mail->ClearAddresses();
return '1';
}
return '0';
}
?>
Hoop dat jullie mij kunnen helpen
Gewijzigd op 27/02/2011 01:17:43 door Leon den H
Stuur je e-mail met HTML headers, en zet je link in a href tags?
Parse error: syntax error, unexpected '<' in /home/****/domains/mijndomein.nl/public_html/class/profilUsers.class.php on line 373
Dit is wat ik gedaan heb
Code (php)
1
2
3
4
5
2
3
4
5
<?php
$body = str_replace("[VERIFICATION_URL]", <a href="$mainUrl."index.php?verification=".$code, $body">;
$body_plain = str_replace("[VERIFICATION_URL]", <a href="$mainUrl."index.php?verification=".$code, $body_plain)">;
?>
$body = str_replace("[VERIFICATION_URL]", <a href="$mainUrl."index.php?verification=".$code, $body">;
$body_plain = str_replace("[VERIFICATION_URL]", <a href="$mainUrl."index.php?verification=".$code, $body_plain)">;
?>
Hoor het wel
het moet wel tussen quotes
Gewijzigd op 27/02/2011 12:13:37 door Wesley PHP