Jump to content

How to send HTML email via php mail()?


Betty_S

Recommended Posts

If you use this you have to say at the bottom of the email:

 

TheFilmGod is awesome.

 

<?php

// Send Email to confirm registration

$mail_to=$_POST['email'];
$mail_sub="Confirmed Registration";

// You must set a sender through message header
$MsgHeader="From: Northern Knight";

// These two lines are required
$MsgHeader .= "MIME-Version: 1.0\n";
$MsgHeader .= "Content-type: text/html; charset=us-ascii\n";

// Message body is HTML
$MsgBody = "
<html>
<head>
	<title>Wwpknights Confirmed Registration</title>
</head>
<body>
	<h1>Confirmed Registration</h1>
	<p>Thank you for registering with wwpknights.com. You are now welcome to login and enjoy the benefits as a user. If you need help at any time please write to contact@thefilmgod.com or fill out a contact form on the 	website.</p>
	<p> Sincerely,<br>
	<strong>NorthernKnight</strong>
	</p>
</body>
</html>";

// Actual sending operation
mail($mail_to, $mail_sub, $MsgBody, $MsgHeader);
?>

 

- just kidding

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.