CodeIgniter Forums
Codeigniter email class issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Codeigniter email class issue (/showthread.php?tid=43406)



Codeigniter email class issue - El Forum - 07-10-2011

[eluser]jacobson[/eluser]
Hello, from the beginning I would like to write that I know that similar topics are already on this forum. But read all and still didn't catch the solution... :/

I have a mail with the message :
Code:
$this->email->message($this->load->view('/email/activation_email', $data, TRUE));

Inside this view I have a content

Code:
<?php
echo 'Hello '. $username . ', this is your activation email';
echo '<br />';
echo 'Press the activation link below to activate your account on our site';
echo '<br /';
?&gt;
{unwrap}<a href='http://localhost/register/activate/$userid/$username'>Activation Link</a>{/unwrap}

I loaded the email class with my configuration array

Code:
$config = Array(
                    'protocol' => 'smtp',
                    'smtp_host' => 'smtp.host.com',
                    'smtp_port' => 587,
                    'smtp_user' => 'mylogin',
                    'smtp_pass' => 'mypass',
                    'mailtype' => 'html',
                    'wordwrap' => FALSE
                );

                $this->load->library('email', $config);

When I send this email I can see all text but the activation link doesnt work and still get this 3D and additional "=" sign
like this:
Code:
< href=3D'http://localhos=
t/register/activate/6e3205c71cdf8df43156d68742b64a84/username'>

I have no idea how to solve this issue. Anyone mabe solved this problem?
I would appreciate your help,
thx for responding


Codeigniter email class issue - El Forum - 07-10-2011

[eluser]Rolly1971[/eluser]
maybe try writing like this:

Code:
<a href="http://localhost/register/activate/&lt;?php echo $userid . '/' . $username; ?&gt;">Activation Link</a>



Codeigniter email class issue - El Forum - 07-10-2011

[eluser]jacobson[/eluser]
but with processing those variables is everything fine, the userid and username are correct.


Codeigniter email class issue - El Forum - 07-10-2011

[eluser]Rolly1971[/eluser]
are you setting the mailtype correctly? $this->email->set_mailtype('html'); ??

not sure if it would make a difference but try removing the {unwrap}{/unwrap} tags.


Codeigniter email class issue - El Forum - 07-11-2011

[eluser]jacobson[/eluser]
I dont know if it's a good solution but I commented out this lines
Code:
if ($ascii == '61') {
//                    $char = $escape . strtoupper(sprintf('s', dechex($ascii)));  // =3D
//                }

in Email library and it works fine...