• 15-06-2010, 15:43:10
    #1
    <?php
    
       
     function php_mail($from_email_address, $from_email_name, $to_email_address, $to_name, $forwarding_to, $reply_address, $reply_address_name, $path_to_attachement, $path_to_more_attachements, $email_subject, $message_body_html) {
         global $mail_error;
    
    $mail = new PHPMailer();
    $mail->PluginDir='./core/phpmailer/';
    // $mail->CharSet=$_SESSION['language_charset']; 
    // $mail->SetLanguage("de",core/phpmailer/language/);
    if (EMAIL_TRANSPORT=='smtp') {
    $mail->IsSMTP(); 
    $mail->SMTPKeepAlive = true;                                    // set mailer to use SMTP
    $mail->SMTPAuth = SMTP_AUTH;                                    // turn on SMTP authentication true/false
    $mail->Username = ;                                // SMTP username
    $mail->Password = ;                                // SMTP password
    $mail->Host = localhost . ';' . SMTP_Backup_Server;      // specify main and backup server "smtp1.example.com;smtp2.example.com"
    }
            
    if (EMAIL_TRANSPORT=='sendmail') {                              // set mailer to use SMTP
    $mail ->IsSendmail();        
    $mail->Sendmail=SENDMAIL_PATH;
    }
    if (EMAIL_TRANSPORT=='mail') {
    $mail ->IsMail();                                                                                 
    }  
    
    
    if ( EMAIL_USE_HTML=='true' )                                   // set email format to HTML
    {
         $mail -> IsHTML(true);
         $mail->Body    = $message_body_html;
         // remove html tags
         $message_body_plain=str_replace('<br>'," \n",$message_body_plain);
         $message_body_plain=strip_tags($message_body_plain);
         $mail->AltBody = $message_body_plain;
    }
    else
    {
         $mail -> IsHTML(false);
         //remove html tags
         $message_body_plain=str_replace('<br>'," \n",$message_body_plain);
         $message_body_plain=strip_tags($message_body_plain);
         $mail->Body    = $message_body_plain;
    } 
    
    $mail->From = $from_email_address;
    $mail->Sender = $from_email_address;
    $mail->FromName = $from_email_name;
    $mail->AddAddress($to_email_address, $to_name);
    if ($forwarding_to!='') $mail->AddBCC($forwarding_to);
    $mail->AddReplyTo($reply_address, $reply_address_name);
    
    $mail->WordWrap = 50;                                             // set word wrap to 50 characters
    //$mail->AddAttachment($path_to_attachement);                     // add attachments
    //$mail->AddAttachment($path_to_more_attachements);               // optional name                                          
    
    $mail->Subject = $email_subject;
    
    
    if(!$mail->Send()){
             echo "Message could not be sent.
    
    ";
             echo "Mailer Error: " . $mail->ErrorInfo;
             exit;
          } 
    }
       
    ?>

    merhaba üste scriptimin mail kısmı var

    server php mail fonksiyonu kapalı

    stmp olarak mail göndermeye çalışıyorum

    Message could not be sent. Mailer Error: Language string failed to load: instantiate

    diye bir hata alıyorum

    ama mail gönderiyor


    // $mail->CharSet=$_SESSION['language_charset'];
    // $mail->SetLanguage("de",core/phpmailer/language/);

    bu ikisini açtığım zaman script çalışmıyor yardımlarınızı bekliyorum
  • 15-06-2010, 15:51:24
    #2
    if(!$mail->Send()){




    }


    echoları sildim hata vermiyor
  • 15-06-2010, 16:26:43
    #3
    localhost ta wamp vs ile çalışıyorsan ondan olabilir geçerli bir smtp serverın olmadıği için.