Glenskie Posted September 28, 2011 Share Posted September 28, 2011 ok well this scripts sends the email but when i put <a href="index.php">hey</a> it desplays it exactly , no link! like it shows all of the html code! <?php require_once "Mail.php"; $from = "glenn"; $to = "[email protected]"; $subject = "From Glenn"; $body = "<a href='index.php'> hey</a>"; $host = "smtp.gmail.com"; $username = "[email protected]"; $password = "password"; $port = "587"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/248070-php-mail-not-working/ Share on other sites More sharing options...
Pikachu2000 Posted September 28, 2011 Share Posted September 28, 2011 That doesn't mean php mail() isn't working. In fact it means the exact opposite, that php mail() is working. Most mail clients do not, by default, render html sent in text emails. See example #4. Quote Link to comment https://forums.phpfreaks.com/topic/248070-php-mail-not-working/#findComment-1273764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.