1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

php html email

Discussion in 'Web & Email' started by kratak, Jul 18, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. kratak

    kratak Thread Starter

    Joined:
    Jan 8, 2005
    Messages:
    112
    Hi

    Im trying to use a script to send a html email to various people. If i send it to a hotmail user and open the email, the email does appear correct, processing the html code. However if you access the same email via Outlook (2003) it comes out showing the code rather than interpreting it.

    Ive tried several websites and the they all talk about the headers. I have tried several different bits of code in the headers, all have had no effect. Any advice welcome.

    Here is my code
    Code:
    <?php 
    
    
    $email = array('[email protected]', '[email protected]');
    
    foreach ($email as $k => $v) {
    
    	$to = $v;
    	$from = "[email protected]";
    	$subject = "subject";
    
    $headers = "From: [email protected]\n"; 
    $headers .= "Message-ID: <" . md5(uniqid(time())) . "@mydomain.com>\n"; 
    $headers .= "MIME-Version: 1.0\n"; 
    $headers .= "Date: ".date("D, d M Y H:i:s") . " UT\n"; 
    $headers .= "Reply-To: [email protected]\n"; 
    $headers .= "Return-Path: [email protected]\n"; 
    $headers .= "X-Priority: 3\r\nX-MSmail-Priority: Normal\n"; 
    $headers .= "X-mailer: php/".phpversion()."\n"; 
    $headers .= "X-MimeOLE: Produced By MyDomain\n"; 
    $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; 
     
    
    $message = "
    <html>
    <body>
    <p><font color='red'>Hello</font></p>
    </body>
    </html>";
    	
    mail($to, $subject, $message,$headers);
    
    	
    	
    }
    ?>
    
     
  2. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
  3. kratak

    kratak Thread Starter

    Joined:
    Jan 8, 2005
    Messages:
    112
    Hi

    Yep saw it soon after i posted here

    ta
     
  4. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    No problem :)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/484263

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice