CodeIgniter Forums

Full Version: Email Message Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hello, am a beginner with codeigniter and php.

I have been following video tutorials and have completed till registration and email confirmation.

However, in the email, i want to send a proper text with formatting such as link and breaks.

Any guide on that please?

Else, can anyone help with the following code?

$body ="<table>";
        $body .="<tr><td>Thank you for registration.</td></tr>";
        $body .="<tr><td>To activate your account, please visit the following URL: </td></tr>";
        $body .="<tr><td><a href='http://localhost/ci/index.php/user/register_confirm/'>Here</a></td></tr>";
        $body .="<tr><td>Thank You.</td></tr>";
        $body .="</table>";
        $mailBody = $body;
        $data = array(
        "BODY" => $mailBody,
        $this->email->message(); // i need to put the array in here, how do i do that?

El Forum

I am surprised that why are you using array to store $mailBody ? You can simply use this


But if you want to use array then you have to use $this->email->message($data['BODY']); ..... You can try the above procedures and please let me know for any query .

El Forum


Both of the above works but still, the main problem am having has not yet been solved.

In the email, i still get :
<table><tr><td>Thank you for registration.</td></tr><tr><td>YouTo activate
your account, please visit the following URL: </td></tr><tr><td><a

Any suggestion how to proceed please?

El Forum

Try this dear $this->email->mailtype(html) and let me know for any query .

El Forum

Yes, it finally works.

Thank you very much Smile

El Forum

You are most welcome dear always .....

El Forum

If you are sending html email, it should be properly formatted starting with the doctype, html, head and body tags just like a regular webpage. Some mail readers won't read/display them unless it is properly formatted, valid html, which the specs call for anyway.