SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Multipart Email

  1. #1
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    531
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multipart Email

    i have this script, but i can't get it to work. i followed the steps listed in the sitepoint article ( http://www.sitepoint.com/article/advanced-email-php/4 ), but no luck. i'm sure i'm just missing something little.

    PHP Code:
    /****** in use ******/

    $plain "Hi! How are you doing?";
    $rich "<strong>Hi!</strong> How are you doing?";

    sendmultipart("bob@aol.com""ann@aol.com",  "Hey There"$plain$rich);

    /****** the function ******/

    function sendmultipart($t$f$s$pt$html) {
        
    $x md5(time());
        
    $h "From: ".$f."\r\n";
        
    $h .= " MIME-Version: 1.0\n\r";
        
    $h .= "Content-Type: multipart/alternative;\n\r";
        
    $h .= "boundary=\"==Multipart_Boundary_x".$x."x\"";
        
    $m "This is a multi-part message in MIME format.

        --==Multipart_Boundary_x"
    .$x."x
         Content-Type: text/plain; charset=\"iso-8859-1\"
         Content-Transfer-Encoding: quoted-printable
         
         "
    .$pt."
         
         --==Multipart_Boundary_x"
    .$x."x
         Content-Type: text/html; charset=\"iso-8859-1\"
         Content-Transfer-Encoding: 7bit
         
         <html>
         <body>
         <p>"
    .$html."</p>
         </body>
         </html>
         
         --==Multipart_Boundary_x"
    .$x."x--";
         
    mail($tstripslashes($s), stripslashes($m), $h);


  2. #2
    SitePoint Zealot dadofgage's Avatar
    Join Date
    Feb 2005
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What kind of error are you getting?

    I copied the code that you have an tested it and it worked for me.

  3. #3
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    531
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm...i'm not getting a php error. it's going through fine, it's just not showing up right in gmail or apple's mail program. it's showing this in my email message...

    Code:
    Content-Type: multipart/alternative;
    
    boundary="==Multipart_Boundary_xca58c10e1d359f9bb27aec4eefad61bcx"
    
    This is a multi-part message in MIME format.
    
    --==Multipart_Boundary_xca58c10e1d359f9bb27aec4eefad61bcx
     Content-Type: text/plain; charset="iso-8859-1"
     Content-Transfer-Encoding: quoted-printable
     
     this is a test message.
     
     --==Multipart_Boundary_xca58c10e1d359f9bb27aec4eefad61bcx
     Content-Type: text/html; charset="iso-8859-1"
     Content-Transfer-Encoding: 7bit
     
     <html>
     <body>
     <p><this is a test message.</p>
     </body>
     </html>
     
     --==Multipart_Boundary_xca58c10e1d359f9bb27aec4eefad61bcx--

  4. #4
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    531
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, i even copied the tutorial word for word now, even and still no luck. :/

  5. #5
    ǖber abstrakt's Avatar
    Join Date
    Dec 2001
    Location
    Earth
    Posts
    261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read in someone elses threads recently that they went ahead and used this instead:
    http://phpmailer.sourceforge.net/

    It looks pretty solid, and just went over the 100,000 download mark. Give it a shot.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •