Jump to content

Sending HTML Emails


Winter0Star

Recommended Posts

I'm having an issue with sending HTML Emails.  Here is my code, but nothing comes out right when it gets emailed.  And my email client is set to view HTML.  I can view other HTML emails just fine, but not these.

 

Here is my code to send the email, just wondering whats wrong with it. Thanks for any suggestions.

 

 

$full_email = $frm_to . '@scotthermanfitness.com';
		//define the receiver of the email
		$to = $full_email;
		//define the subject of the email
		$subject = 'Form Submit - SHF ' . $to_text . ' (' . $frm_name . ')'; 
		//create a boundary string. It must be unique 
		//so we use the MD5 algorithm to generate a random hash
		$random_hash = md5(date('r', time())); 
		//define the headers we want passed. Note that they are separated with \r\n
		$headers = "From: " . $frm_email . "\r\nReply-To: " . $frm_email;
		//add boundary string and mime type specification
		//$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 
		$headers .= " Content-type: text/html\r\n"; 
		//begin of HTML message 
		$message = $frm_content; 

		//send the email
		$mail_sent = @mail( $to, $subject, $message, $headers );

Link to comment
https://forums.phpfreaks.com/topic/229580-sending-html-emails/
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.