Search code examples
codeigniterhyperlinkgmailhref

Using codeigniter 4, cannot send link in gmail


$message = "Hi ".$name.", <br>Your account is created successfully. Please click the below link to activate your account
<br><br><a href=".base_url()."/register/activate/".$uniid."Activate now </a>";

I already recieved the email but the href function is excluded. it only display "Hi myname, Your account is created successfully. Please click the below link to activate your account";

it dont display the link


Solution

  • You have syntax errors in your code.

    1. Missing > in anchor tag".$uniid."Activate now
    2. Wrong href dicleration href=".base_url()."/register/activate/".$uniid."
    3. wrap inner conditions with '.

    Use below code

    $message = "Hi {$name}, <br>Your account is created successfully. Please click the below link to activate your account
    <br><br><a href='/register/activate/{$uniid}'>Activate now </a>";