Jump to content

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

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.