Jump to content

php mail not working


Glenskie

Recommended Posts

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>");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/248070-php-mail-not-working/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.