cozzy1984 Posted February 12, 2008 Share Posted February 12, 2008 Hi there, just managed to get a email activation working although the only problem i'm having is actually displaying the url link in the email. It is only outputting it as text and not a clickable link. Know this is probably really simple but, would really appreciate if someone could show me how to. My code is: $mail->Body = "Your account has been successfully created with the following details:\n\nUsername: $username\nPassword: $password\nEmail: $email\nForename: $forename\nSurname: $surname\nLocation: $location\n\nPlease click on the link to activate your account.\n<a href'http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code'>Activate Account</a>"; Link to comment https://forums.phpfreaks.com/topic/90686-insert-url-link-into-email/ Share on other sites More sharing options...
aschk Posted February 12, 2008 Share Posted February 12, 2008 You need to change the format of your mail to text/html Link to comment https://forums.phpfreaks.com/topic/90686-insert-url-link-into-email/#findComment-464857 Share on other sites More sharing options...
Neptunus Maris Posted February 12, 2008 Share Posted February 12, 2008 <a href'http: Wrong! baby... this should help <a href = 'http (and the rest of the link) you forgot the "=" Link to comment https://forums.phpfreaks.com/topic/90686-insert-url-link-into-email/#findComment-464860 Share on other sites More sharing options...
GameYin Posted February 12, 2008 Share Posted February 12, 2008 <a href'http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code'> should be <a href="http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code"> Do you knowHTML lol? JP Link to comment https://forums.phpfreaks.com/topic/90686-insert-url-link-into-email/#findComment-464862 Share on other sites More sharing options...
cozzy1984 Posted February 12, 2008 Author Share Posted February 12, 2008 <a href'http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code'> should be <a href="http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code"> Do you knowHTML lol? JP Sorry, i do have the = but it doesn't work with it. How do u change the type to text/html asch? I have: $mail = new PHPGMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = 'ssl://smtp.gmail.com'; // SMTP servers $mail->Username = '*****@gmail.com'; $mail->Password = '******'; $mail->From = '*****@gmail.com'; $mail->FromName = 'test'; $mail->Subject = 'test Registration'; $mail->AddAddress($email); $mail->Body = "Your account has been successfully created with the following details:\n\nUsername: $username\nPassword: $password\nEmail: $email\nForename: $forename\nSurname: $surname\nLocation: $location\n\nPlease click on the link to activate your account.\n"; $mail->Body .= "<a href='http://localhost/Ad'll%20Do/activate.php?username=$username&&do=$active_code'>Activate Account</a>"; Link to comment https://forums.phpfreaks.com/topic/90686-insert-url-link-into-email/#findComment-464870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.