Url Manager

$body .= “<a href='pruebar/web/index.php?r=registro/confirm&id=”.$id."&authKey=".$authKey."’>Confirmar</a>";

You should use "Html::a()" to create a link.

$body .= Html::a('Confirmar', ['registro/confirm', 'id' => $id, 'authKey' => $authKey]);

Guide > Html helper > Hyperlinks


Guide > Url helper > Creating Urls


By using these methods in Yii, you can always create a valid url whether you will enable ‘pretyUrl’ or not.


in my email i dont have a link only the rute :c how to resolve this problem?

Oh, I’m sorry. You are composing a mail text in which the link should be an absolute one.

Try the following:

$body .= Html::a('Confirmar', 

    Url::to(['registro/confirm', 'id' => $id, 'authKey' => $authKey], true)


Please check the API reference of HTML::a().

thanks for all the problem is solved and i check the API :)