Jump to content

Sending HTML in mail()?


HDFilmMaker2112

Recommended Posts

How would I go about sending HTML through the mail() function?

 

I'm currently using <br/> tags <a> tags and when I run the script and have the email sent to me, all the tags are visible.

 

	/*Generate activation email*/
	$to=$register_email;
	$subject='Activate Your Kynxin Membership';
	$headers='From: [email protected]';
	$message='Thank you for registering for Kynxin.<br/>
	<br/>
	Please visit the following link to activate your account.
	<a href="http://www.kynxin.com/signup/activate.knxn?activate='.$activation_number.'">
                http://www.kynxin.com/signup/activate.knxn?activate='.$activation_number.'</a>
	<br/>
	<br/>
	Thank You,<br/>
	The Kynxin Support Team
	';
	/*Send registration activation email*/
	mail($to, $subject, $message, $headers);

Link to comment
https://forums.phpfreaks.com/topic/264071-sending-html-in-mail/
Share on other sites

You really should consider using something like PHPMailer. It will make your life easier where this is concerned.

 

That just seems like it adds so much overhead to something that should be so simple. You have to add another file in, additional processing, etc. I just don't see what advantage that has over the regular mail() function.

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.