Pain Posted October 23, 2012 Share Posted October 23, 2012 Hello. I've built a mailer class specifically for account activation. <?php class Mail { public $unique; public $subject = "You must activate your account"; public $message = "Please click on the link below to activate your account "; public $headers = "This is automatically generated email, please do not respond to it."; public function sendActivationMail($to) { $this->unique = md5(uniqid(rand())); if (!mail($to, $this->subject, $this->message, $this->headers)) { return false; } else { return true; } } } ?> However i am unable to add property $unique to my message (in this case it is $message). How can i do this? Thanks:] Link to comment https://forums.phpfreaks.com/topic/269814-adding-two-strings-in-oop/ Share on other sites More sharing options...
Jessica Posted October 23, 2012 Share Posted October 23, 2012 $this->message .= ' Unique: '.$this->unique; Link to comment https://forums.phpfreaks.com/topic/269814-adding-two-strings-in-oop/#findComment-1387169 Share on other sites More sharing options...
Pain Posted October 23, 2012 Author Share Posted October 23, 2012 Lol, how stupid of me. Thanks:] Link to comment https://forums.phpfreaks.com/topic/269814-adding-two-strings-in-oop/#findComment-1387170 Share on other sites More sharing options...
Jessica Posted October 23, 2012 Share Posted October 23, 2012 No problem BTW, if the problem was because you were trying to use a double-quoted string, use curly braces. $this->message .= " Unique: {$this->unique}"; Link to comment https://forums.phpfreaks.com/topic/269814-adding-two-strings-in-oop/#findComment-1387171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.