Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Mail Format Problems! Please Help
Old 07-24-2006, 07:52 PM Mail Format Problems! Please Help
cpfreak23's Avatar
Super Talker

Posts: 143
Trades: 0
Ok I have a little mail parser (if thats what you want to call it) that gets variables and puts them into a message. Pretty simple right? I wish. It seems that when viewing the email in any version of Microsoft Outlook (and i presume other non-online email readers) it displays the message like this:
Code:
Content-Type: text/html; encoding="UTF-8"

Content-Transfer-Encoding: 8bit



<html>
<head>
<title>Epiphany Youth Community</title>
</head>
<body>

test

</body>
</html>
The code that 'parses' the email message looks like this:


PHP Code:
if ($to != '') {
    
$boundary "-----=".md5(uniqid(rand()));

    
$headers "Reply-to: $from\r\nFrom: $from\r\n";
    if (
$cc != '') {
        
$headers .= "Cc: $cc\r\n";
    }
    if (
$bcc != '') {
        
$headers .= "Bcc: $bcc\r\n";
    }
    

    
$headers .= "Content-Type: multipart/mixed;\n\tboundary=\"$boundary\"\n\n";
    
$headers .= "MIME-Version: 1.0\n";
    

    (!
get_option('ml_sending_encoding')) ? ($encoding '8bit') : ($encoding 'base64') ;
    if (
$encoding == 'base64') { $content chunk_split(base64_encode($content)); }

    
$msg .= "--$boundary\n\n";
    
$msg .= "Content-Type: $type_content; encoding=\"".get_bloginfo('charset')."\"\n\n";
    
$msg .= "Content-Transfer-Encoding: $encoding\n\n";
    
$msg .= "\n\n";
    
$msg .= $content;
    
$msg .= "\r\n"
The part
PHP Code:
    $msg .= "--$boundary\n\n";
    
$msg .= "Content-Type: $type_content; encoding=\"".get_bloginfo('charset')."\"\n\n";
    
$msg .= "Content-Transfer-Encoding: $encoding\n\n";
    
$msg .= "\n\n";
    
$msg .= $content;
    
$msg .= "\r\n"
seems to be off somehow. Any ideas anyone?
cpfreak23 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-24-2006, 11:46 PM Re: Mail Format Problems! Please Help
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Yes, the headers are being included in the body message. Change the 2nd and 3rd $msg line and change the variable to $headers .= . . .

The same needs to happen with the line --$boundary\n\n but needs to be moved after the last two chages I showed above.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Mail Format Problems! Please Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18016 seconds with 12 queries