How do i turn the link in the $message to a active clickable link in the email ?
Here is the code :
<?
include("connection.php");
include("functions.php");
if(isset($toname))
{
$template=getTemplate("EMAILFRIEND");
$template=str_replace("%fromname%",$fromname,$template);
$template=str_replace("%toname%",$toname,$template);
$template=str_replace("%message%",$message,$template);
sendHTMLmail($fromemail,$toemail,"Email from $fromname",$template);
$mmessage="Email has been sent to $toname($toemail)";
}
$sql="select * from members where username='$ses_username'";
$res=mysql_query($sql);
while($obj=mysql_fetch_object($res))
{
$email=$obj->email;
$fname=$obj->fname;
$lname=$obj->lname;
}
$message="Hey check out this $urldomain/index.php?cmd=6&recid=$phid";
?>
Here is the function :
function getTemplate($val)
{
$sql="select * from emailtemplates where usedfor='$val'";
$res=mysql_query($sql);
while($obj=mysql_fetch_object($res))
{
$template=$obj->template;
$template=str_replace("\n","<br>",$template);
return $template;
}
}