BetaONE will rise again!

BetaONE will rise again! (http:\\b1.hcanet.com\forum/index.php)
-   Web Development (http:\\b1.hcanet.com\forum/forumdisplay.php?f=50)
-   -   Php Email (http:\\b1.hcanet.com\forum/showthread.php?t=10298)

*MO* 5th Jan 04 03:05 PM

Hey peeps.

When i send an email using php, it does not send it as HTML instead as normal TXT.
ie: when i send a link to email ---> bla bla

but then it shows the code instead of it being a clickable link.
ie: it shows bla bla

How can i make it be a link and not the code?

thanx
Mo

SlickVic78 5th Jan 04 06:03 PM

Hey *MO*,

May we see a code sample of what you a have at the moment?

Thanks,
-SlickVic78

*MO* 6th Jan 04 08:43 AM

<?
function sentMail( $from, $to, $subject, $body ) {
$fd = popen("/usr/sbin/sendmail -t","w");
fputs($fd, "To: $to\n");
fputs($fd, "From: $from\n");
fputs($fd, "Subject: $subject\n");
fputs($fd, "X-Mailer: PHP\n");
fputs($fd, "Body: $body\n");
pclose($fd);
}

$aTmp = $message;
$aTmp .= $recieverName;
$aTmp .= $sender;

$sMd5 = md5(serialize($aTmp));

$now = mktime (date("H"),date("i"),date("s"), date("m") ,date("d"),date("Y"));
$Daytoday=date("Y-m-d H:i:s", $now);

$message = "\n\n";
$message .= "Hello $recieverName\n\n";
$message .= "You recieved an e-card from $sender";
$message .= "\n\n";
$message .= "<a href='http://www.jmrhapsody.za.net/index.php?getEcard.php?id=$sMd5''>Click here to read it</a>\n\n";
$message .= "\n";
$message .= "Thank you for using Rhapsody e-cards\nwww.jmrhapsody.za.net";
sentMail( "RHAPSODY E-CARDS", "moosthuizen@mweb.com", "YOU RECIEVED AN E-CARD FROM $sender", $message );

?>

SlickVic78 6th Jan 04 08:14 PM

Hey *MO*,

In order for your emails to be sent in HTML form, rather than plain text, you need to send the content-type through within the header. If you don't specify a content-type, it defaults to plain text.

Quote:


$headers .= "--$boundary\r\n"."Content-Type: text/html; charset=ISO-8859-1\r\n";

That should allow the user who receives your email to see the link in proper form, and not all the code.

Hope this helps,
-SlickVic78


All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.