2012-02-02 15 views
5

aldığım bir e-posta kullanarak smtp göndermeye çalışırken bu hata:Dil dize Yüklenemeyen: from_failed [from_email_address]

Language string failed to load: from_failed**[email protected]** 

İşte benim kod:

$mail = new PHPMailer(); 
        //$mail->SetLanguage('en',dirname(__FILE__) . '/phpmailer/language/'); 
        $SMTP_Host = "smtp.gmail.com"; 
        $SMTP_Port = 465; 
        $mail->SMTPSecure = 'ssl'; 

        $SMTP_UserName = "[email protected]"; 
        $SMTP_Password = "****"; 
        $from = "[email protected]"; 
        $fromName = "My Name"; 
        $to = "[email protected]"; 

        $mail->IsSMTP(); 
        $mail->Host  = $SMTP_Host; 
        $mail->SMTPAuth = true; 


        $mail->Username = $SMTP_UserName; 
        $mail->Password = $SMTP_Password; 

        $mail->From  = "[email protected]"; 
        $mail->FromName = "From Name"; 
        $mail->AddAddress("[email protected]"); 
        $mail->AddReplyTo($from, $fromName); 

        $mail->IsHTML(true); 

        $mail->Subject = "This is an message from our website"; 
        $mail->Body  = $design; 

        if(!$mail->Send()) 
        { 

         echo "Error : " . $mail->ErrorInfo; 
         exit; 
        } 

bunu nasıl düzeltebilirim?

+0

. Herhangi bir çözüm? – oneofakind

cevap

7

Bu genellikle phpMailer sınıfınızın, bir ileti göndermeye çalışırken dil dosyasını bulamıyor anlamına gelir. Bunu düzeltmek için

kolay yolu elle dil klasörünün yolu da dahil olmak dilini ayarlamaktır:

$mail = new PHPMailer(); 
$mail->SetLanguage("en", 'includes/phpMailer/language/'); 

Bu dil klasöründe var. Veya sadece bu kaynağına SetLanguage yöntemini işaret edebilir:

1 <?php 
    2 /** 
    3 * PHPMailer language file. 
    4 * English Version 
    5 */ 
    6 
    7 $PHPMAILER_LANG = array(); 
    8 
    9 $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' . 
    10          'recipient email address.'; 
    11 $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.'; 
    12 $PHPMAILER_LANG["execute"] = 'Could not execute: '; 
    13 $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.'; 
    14 $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.'; 
    15 $PHPMAILER_LANG["from_failed"] = 'The following From address failed: '; 
    16 $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' . 
    17           'recipients failed: '; 
    18 $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.'; 
    19 $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.'; 
    20 $PHPMAILER_LANG["file_access"] = 'Could not access file: '; 
    21 $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: '; 
    22 $PHPMAILER_LANG["encoding"] = 'Unknown encoding: '; 
    23 ?> 
+1

Sunucuda 'includes/phpMailer/language /' klasörü yok. Bunu oluşturmam gerekiyor mu? –

+0

2. hattınızı kaldırın. '// $ mail-> SetLanguage ('en', dirname (__ FILE__). '/ phpmailer/language /'); – Mob

+0

Denedim ama şansım yoktu. Aynı sorunu ele alan –

0

SMTP SMTP kullanıcı adı ve şifreyi kontrol kullanıyorsanız. Aynı sorun gmail şifresi istemci tarafından güncellendi. Aynı sorunu ele alan