2016-03-20 17 views
0

Birisi zaten online baktım ve benim sadece düz metin e-posta alıyorum aklınıza gelebilecek her şeyi denedim tavsiyelerde misiniz çalışma postalar sadece HTML şeyler değil $ Bed (html) yerine ham kodda (ileti) alırım. İşte php smtp ssl html</p> <p>Eposta kısmı çalışıyor ...

benim kodudur:

<?php 
require_once "Mail.php"; 

$from = "Home Calendar <[email protected]>"; 
$to = "Me Yahoo <[email protected]>, Me Gmail <[email protected]>"; 
$subject = "TESTING PHP EMAIL"; 
$body = " 
<html> 
    <head> 
     <title>HTML email</title> 
    </head> 
    <body> 
     <p>This email contains HTML Tags!</p> 
    <table> 
     <tr> 
      <th>Firstname</th> 
      <th>Lastname</th> 
     </tr> 
     <tr> 
      <td>Ricardo</td> 
      <td>Wagemaker</td> 
     </tr> 
    </table> 
    </body> 
</html> 
"; 

$host = "ssl://mail.domain.co.uk"; 
$port = "465"; 
$username = "[email protected]"; 
$password = "password"; 

$headers = array (
     "MIME-Version: 1.0", 
     "Content-type: text/html; charset=ISO-8859-1", 
     'From' => $from, 
     'To' => $to, 
     'Subject' => $subject 
     ); 

$smtp = Mail::factory('smtp', 
    array ('host' => $host, 
    'port' => $port, 
    'auth' => true, 
    'username' => $username, 
    'password' => $password)); 

$mail = $smtp->send($to, $headers, $body, $from, $subject); 

if (PEAR::isError($mail)) { 
    echo("<p>" . $mail->getMessage() . "</p>"); 
    } else { 
    echo("\n\n<p>Message successfully sent!</p>\n\n"); 
    } 
?> 

Çok teşekkürler

cevap

0

Eh hiçbir yardım ama sonunda anladım, hepsi benim başlıklarından kayıp "rn" yeni hat ilgiliydi ..

İşte çalıştıran değişiklik.

$headers = array (
    'MIME-Version' => '1.0rn', 
    'Content-Type' => "text/html; charset=ISO-8859-1rn", 
    'From' => $from, 
    'To' => $to, 
    'Subject' => $subject 
);