Jump to content

Mail text/html question


The14thGOD

Recommended Posts

Hey,

 

I'm a little confused. I want to be able to send a link in an authentication email so the user can just click on it but it does not work in all emails. I was told I had to somehow tell the email that it was html too.

 

I've located this:

Content-Type: multipart/alternative and

Content-Type: text/html; charset=iso-8859-1

 

Do I include that just in the body of my message or do I need to include something else, this is my code:

<?php 	//User Passed Tests, Enter into datbabase
$query = "blah blah";
if (mysql_query($query)) {
	$body = "Thank you $username for making an account at somewhere.com! \n";
	$body .= "Please click on the following link in order to activate your account or depending on your email service, you may need to copy and paste the following link into your URL. \n\n";
	$body .= "somewhere.com/activate.php?auth_code=$rand_id \n\n";
	$body .= "Enjoy. \n";
	$body .= "Me";
	$body .= "If you recieved this email on accident please ignore it and throw it away. Thank you and sorry for the inconvience.";
	mail("$email" , "Activation Link for somewhere.com" , $body, "From: me \r\n");
	$error = 'added';
	header("Location: login.php?error=$error");
	exit(0);
}
?>

 

Thank you for any help.

 

The14thGOD

Link to comment
https://forums.phpfreaks.com/topic/40018-mail-texthtml-question/
Share on other sites

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.