this.user Posted October 6, 2011 Share Posted October 6, 2011 I am trying to eliminate this issue but I have had no luck here is my current code: $from = '[email protected]'; $body = "<html>\n"; $body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif;\">\n"; $body .= $message; $body .= "</body>\n"; $body .= "</html>\n"; $boundary = uniqid('np'); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "From: $from"; $headers .= "\nMIME-Version: 1.0\n" ."Content-Type: multipart/alternative;\n" ." boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; \n" . "Content-Transfer-Encoding: 7bit\n\n" . $body . "\n\n" . "--{$mime_boundary}--\n"; mail($to, $subject, $message, $headers, '-f'.$from); I have tried adding the plain text part but nothing has worked, could someone else look at this and show me what I need to add so that it has the text/plain MIME part as well? Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/ Share on other sites More sharing options...
this.user Posted October 6, 2011 Author Share Posted October 6, 2011 bump Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276527 Share on other sites More sharing options...
requinix Posted October 6, 2011 Share Posted October 6, 2011 I have tried adding the plain text part And what did that code look like? Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276547 Share on other sites More sharing options...
this.user Posted October 6, 2011 Author Share Posted October 6, 2011 $headers = "From: $from"; $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" ."Content-Type: multipart/alternative;\n" ." boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" . . "--{$mime_boundary}\n" . "Content-Type: text/html; \n" . "Content-Transfer-Encoding: 7bit\n\n" . $body . "\n\n" . "--{$mime_boundary}\n" . 'Content-Type: text/plain; charset="utf-8"' . "\n" . 'Content-Transfer-Encoding: 7bit' . "\n\n" . 'This is a HTML email and your email client software does not support HTML email!' . "\n\n" . "--{$mime_boundary}--\n"; Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276551 Share on other sites More sharing options...
requinix Posted October 6, 2011 Share Posted October 6, 2011 There are a few errors with that code, and one of them is a PHP error that would prevent the script from running. Is that your actual code? Literally copied and pasted from the file? Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276567 Share on other sites More sharing options...
this.user Posted October 7, 2011 Author Share Posted October 7, 2011 the script works fine, i must of edit it incorrectly $from = '[email protected]'; $body = "<html>\n"; $body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif;\">\n"; $body .= $message; $body .= "</body>\n"; $body .= "</html>\n"; $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "From: $from"; $headers .= "\nMIME-Version: 1.0\n" ."Content-Type: multipart/alternative;\n" ." boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; \n" . "Content-Transfer-Encoding: 7bit\n\n" . $body . "\n\n" . "--{$mime_boundary}\n" . 'Content-Type: text/plain; charset="utf-8"' . "\n" . 'Content-Transfer-Encoding: 7bit' . "\n\n" . 'This is a HTML email and your email client software does not support HTML email!' . "\n\n" . "--{$mime_boundary}--\n"; mail($to, $subject, $message, $headers, '-f'.$from); Here is the email source Authentication-Results: hotmail.com; sender-id=temperror (sender IP is *****) [email protected]; dkim=none header.d=me.com; x-hmca=none X-Message-Status: n:0:n X-SID-PRA: [email protected] X-DKIM-Result: None X-AUTH-Result: NONE X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtTQ0w9NA== X-Message-Info: 6sSXyD95QpXDYhE6zcmtxkWgR951auLXZ7lJ145zV4MVVKBAPv5jZJLe26XameVxvmrrP3NyAspwPYnm7OkXE1Ey9jSmv+LJYZTYTRZI3IpFee+j1rD7gPirv+dmpP1iFxq/Zeb1xZY= Received: from p3plsmtps2ded03-01.prod.phx3.secureserver.net ([****]) by SNT0-MC1-F6.Snt0.hotmail.com with Microsoft SMTPSVC(*****); Thu, 6 Oct 2011 19:42:36 -0700 Received: (qmail 7411 invoked from network); 7 Oct 2011 02:42:35 -0000 Received: from unknown (HELO ip-****.ip.secureserver.net) ( ***** ) by p3plsmtps2ded03-01.prod.phx3.secureserver.net (***0) with ESMTP; 07 Oct 2011 02:42:35 -0000 Received: (qmail 15779 invoked by uid 48); 6 Oct 2011 22:42:35 -0400 Date: 6 Oct 2011 22:42:35 -0400 Message-ID: <20111007024235.15777.qmail@ip-****.ip.secureserver.net> To: [email protected] Subject: Account Activation X-PHP-Originating-Script: 0:email.utility.php From: [email protected] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="==Multipart_Boundary_x9a68e36d072eec0730e7bac6a9f1b0b6x" Return-Path: [email protected] X-OriginalArrivalTime: 07 Oct 2011 02:42:36.0106 (UTC) FILETIME=[C58CA2A0:01CC849A] This is a multi-part message in MIME format. --==Multipart_Boundary_x9a68e36d072eec0730e7bac6a9f1b0b6x Content-Type: text/html; Content-Transfer-Encoding: 7bit <html> <body style="font-family:Verdana, Verdana, Geneva, sans-serif;"> Dear asd,<br /><br /> Please click on this link to activate your me.com account: <a href="http://www.me.com/activation/?code=0d16f16c88840609cde3697c24dc3e8d3184988a17ea1b1bd26c5cf5abf4891945c57e">http://www.me.com/activation/?code=0d16f16c88840609cde3697c24dc3e8d3184988a17ea1b1bd26c5cf5abf4891945c57e</a><br /><br /> Thank you,<br /><br /><br /><br /><br />me.com!</body> </html> --==Multipart_Boundary_x9a68e36d072eec0730e7bac6a9f1b0b6x Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit This is a HTML email and your email client software does not support HTML email! --==Multipart_Boundary_x9a68e36d072eec0730e7bac6a9f1b0b6x-- and here is the MSQ data MQS Score: 78 of 100 SPAM: BODY: Message only has text/html MIME parts (-17) SPAM: URI: URI hostname has long non-vowel sequence (-5) Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276658 Share on other sites More sharing options...
this.user Posted October 7, 2011 Author Share Posted October 7, 2011 bump Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276945 Share on other sites More sharing options...
requinix Posted October 7, 2011 Share Posted October 7, 2011 Well the text/plain part is right there... I'm wondering if this MQS thing is buggy. Try moving the text part before the HTML part. Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276973 Share on other sites More sharing options...
this.user Posted October 7, 2011 Author Share Posted October 7, 2011 I've tried that. I think it must be either a syntax error that I am not seeing or a format error Link to comment https://forums.phpfreaks.com/topic/248558-email-issue-spam-body-message-only-has-texthtml-mime-parts-17/#findComment-1276978 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.