Jump to content

Multipart Mail Problem


Intervelopment

Recommended Posts

Hey All,

 

Im trying to write a function that sends a multipart email .... but when i run it, it just returns an empty email.

 

Could someone have a quick look and let me know where im going wrong.

 

   function Welcome($user, $email, $pass, $activation_key){
   	  $userurl = str_replace(" ", "%20", $user);
   	  $random_hash = "s1_" . md5(date('r', time()));
   	  
   	  $headers = "MIME-Version: 1.0" . "\r\n";
   	  $headers .= "X-Mailer: My Mailer" . "\r\n";
   	  $headers .= "Reply-to: [email protected] <[email protected]>" . "\r\n";
   	  $headers .= "From: [email protected] <[email protected]>" . "\r\n";
   	  $headers .= "Content-type: multipart/alternative; boundary=\"$random_hash\"";
   	  
      $subject = "This is the subject";
      $body = "
      
		--$random_hash
		Content-type: text/plain; charset=\"iso-8859-1\"
		Content-Transfer-Encoding: 7bit
		      		
			Text email goes here
						      		
		--$random_hash
		Content-Type: text/html; charset=\"iso-8859-1\"
		Content-Transfer-Encoding: 7bit
		      		
			<html>
			<head>
				<title>Title</title>
			</head>

			<body bgcolor=\"#FFFFFF\">
			<p>Test</p>

			</body>
			</html>

		--$random_hash--
      ";
      
      return mail($email,$subject,$body,$headers);

Link to comment
https://forums.phpfreaks.com/topic/185427-multipart-mail-problem/
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.