Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    htm mail sending problem

    my codes are like following. i wanna send it as html But it is sent as text

    PHP Code:
            // HTML mail göndermek için içierk tipi ve başlık olamlı
            
    $headers  'MIME-Version: 1.0';
            
    $headers .= 'Content-type: text/html; charset=iso-8859-9';        
            
    $headers .= 'From: '.$from .' <'.$email.'>' "\r\n";

            
            
    $to             "info@codingforums.com";
            
    $subject        $konu." (".$baslik.")";
            
    $message        
                            
    '    
                            
                                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                <html xmlns="http://www.w3.org/1999/xhtml">
                                <head>
                                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
                                <title>ADSL</title>
                                </head>    
                                <body>
                                    <table class="mail_tablo">

                                      <tr>
                                        <td class="mail_td1"><div align="right">name :</div></td>
                                        <td>'
    .strip_tags($ad).'</td>
                                      </tr>
                                      <tr>
                                        <td class="mail_td1"><div align="right">father name :</strong></div></td>
                                        <td>'
    .strip_tags($akizlik).'</td>
                                      </tr>
                                </table>
                            </body>
                            </html>
                                '
    ;                                
            
    $ulak         imap_mail(
                                    
    $to,
                                    
    strip_tags($subject),
                                    
    strip_tags($message,"<br>"),
                                    
    $headers
                             
    ); 

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Using strip_tags on you're message will do that.
    Remove the strip_tags call in the mail method. You want/need to keep all of you're markup not just you're <br /> tags.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    Using strip_tags on you're message will do that.
    Remove the strip_tags call in the mail method. You want/need to keep all of you're markup not just you're <br /> tags.
    i removed all strip_tags but it is text message not html

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Does you're text include the markup? If so, chances are its a problem with you're mail configurations, not with you're sending of it. If not, double check you're not running a cached version of the page and try again.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    my text and codes are like above

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Sounds to me then that its just the receiving of the email. Best I know, the imap methods handle the same header functionality as just the standard mail, so passing the content-type for the html should do it.

    Oh wait a minute:
    PHP Code:
    $headers  'MIME-Version: 1.0';
            
    $headers .= 'Content-type: text/html; charset=iso-8859-9';        
            
    $headers .= 'From: '.$from .' <'.$email.'>' "\r\n"
    That might be what's killing it. Change that to:
    PHP Code:
    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-9' "\r\n";        
    $headers .= 'From: '.$from .' <'.$email.'>' "\r\n"
    Noticed I added the form feeds at the end of each header. Try that, post back.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #7
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    this is incoming mail in outlook



  •  

    Posting Permissions

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