2017-03-16 352 views
1

我有这样的代码:电子邮件附件

    $this->load->library('email'); 
        $this->email->clear(TRUE); 
        $this->email->set_newline("\r\n"); 
        $this->email->from($edata[0]->eEmail, TITLEWEB); 
        $this->email->to($vendor[0]->cEmail); 

        $replace = array("[RECEIVER]","[SENDER]","[REQUESTTITLE]","[REFERENCE]","[POREF]"); 
        $replacewith = array($vendor[0]->displayName, FNAME." ".LNAME, $purchase[0]->pTitle, $quote[0]->qReference,strtoupper($prorder)); 
        $str = str_replace($replace,$replacewith,$edata[0]->eContent); 
        $message = $str; 
        $subjet = str_replace("[SENDER]",FNAME." ".LNAME,$edata[0]->eSubject); 
        $this->email->subject($subjet); 
        $this->email->message($message); 

        $this->email->set_mailtype("html"); 
        $this->email->attach('resources/uploads/pdfs/'.strtoupper($prorder).".pdf"); 
        $send = $this->email->send(); 

电子邮件被正确地来,但附件不proprly显示或Hotmail或YAHO显示损坏.. 附件原来的尺寸是: 16K 但其在电子邮件只显示332Byte

能否请你告诉我有什么问题..中号停留在此的最后2天........

enter image description here

+0

请请别人提供解决方案.......... :( – DeDevelopers

+0

)您可以在'$ this-> email-> send后添加'$ email_respone = $ this-> email-> print_debugger();'' ();'然后''var_dump'' $ email_response'来查看可能发生的消息 –

+0

可能找不到您的附件文件 –

回答

0

尝试使用$this->email->clear(); as as使用TRUE清除附件。