CodeIgniter Forums
Emails Not Sending - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Emails Not Sending (/showthread.php?tid=14924)



Emails Not Sending - El Forum - 01-20-2009

[eluser]Bl4cKWid0w[/eluser]
My script is supposed to send out an email upon registration for account activation. For some reason, users that register do not receive this email. Everything else works fine, just not the email. This is my code:

Code:
$config['mailtype'] = 'html';
            $this->load->library('email');
            $this->email->to($user['email']);
            $this->email->from("Fourth Core Dot Com");
            $this->email->subject("Activate Your Account");
            $this->email->message("&lt;HTML&gt;Hello, ".$user['displayname']."!  You recently filled out a registration form at FourthCore.com.  If you did not, ignore this email.  To complete the registration process, you must first activate your account.  You can do this by clicking on the link below.<br><br><a href='http://www.fourthcore.com/register/activate/".$user[' target='new'>http://www.fourthcore.com/register/activate/".$user['activationcode']."'<br><br>Thank you for registering,<br>The Fourth Core Team&lt;/HTML&gt;");
            $this->email->send();



Emails Not Sending - El Forum - 01-20-2009

[eluser]Michael Wales[/eluser]
Syntax error in $this->email->message()
Code:
.$user['

Additionally, why use double-quotes if you are concatenating for all of the variables? That's the only benefit to double-quotes - parsing variables without concatenation (it's slower BTW).

Plus, you are using single quotes to surround HTML attributes, which invalidates your HTML.