2013-03-10 45 views
0

我的應用程序在線。無法發送來自codeigniter的電子郵件

我寫下面的代碼發送電子郵件到指定的電子郵件地址。

我收到了「郵件發送成功」的短信,但我無法收到郵件。可能是什麼原因。請幫幫我!

Controller.php這樣:

if ($this->form_validation->run() === TRUE) 
     { $this->load->library('email'); 
      $name=$this->input->post('fullname'); 
      $sendersemail=$this->input->post('email'); 
      $fromcountry=$this->input->post('countryname'); 
      $message=$this->input->post('contactdetails'); 
      $this->email->from($sendersemail, $name.'From'.$fromcountry); 
      $this->email->to('[email protected]'); 
      $this->email->cc('[email protected]'); 
      $this->email->bcc('[email protected]'); 
      $this->email->subject('New Customer Contact from thmywebsite.com'); 
      $this->email->message($message); 
      $this->email->send(); 
      $this->session->set_flashdata('msg', 'Thankyou for contacting us .We will shortly reply back on this ('.$this->input->post('email').') email '); 
      redirect(current_url()); 
     } 

UPDATE:保持調試後:我收到這樣

Your message has been successfully sent using the following protocol: mail 
    From: 
    Return-Path: 
    Cc: [email protected] 
    Bcc: [email protected] 
    Reply-To: "[email protected]" 
    X-Sender: [email protected] 
    X-Mailer: CodeIgniter 
    X-Priority: 3 (Normal) 
    Message-ID: <[email protected]> 
    Mime-Version: 1.0 
    Content-Type: multipart/alternative; boundary="B_ALT_513e08c9defa1" 


    =?utf-8?Q?New_Customer_Contact_from_thebestbookfinder.com?= 
    This is a multi-part message in MIME format. 
    Your email application may not support this format. 

    --B_ALT_513e08c9defa1 
    Content-Type: text/plain; charset=utf-8 
    Content-Transfer-Encoding: 8bit 

    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf 
    dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf 
    dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf 
    dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf 
    dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak 


    --B_ALT_513e08c9defa1 
    Content-Type: text/html; charset=utf-8 
    Content-Transfer-Encoding: quoted-printable 

    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak= 
    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak= 
    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak= 
    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak= 
    asd fsfsfs d hjfsdjf dsakasd fsfsfs d hjfsdjf dsak 

    --B_ALT_513e08c9defa1-- 
+0

「發件人」地址應該解析爲您要發送郵件的服務器。對輸入的地址使用'reply-to' – 2013-03-10 20:35:25

+0

在$ this-> session-> set_flashdata('msg','Thankyou聯繫我們,我們將很快回復此('。$ this-> input - > post('email')。')email');把這個併發布結果echo $ this-> email-> print_debugger(); – 2013-03-10 20:40:57

+0

@Pekka웃對不起,我沒有得到你所解釋的。請解釋它litle。 – 2013-03-10 20:46:03

回答

0

輸出儘量把低於$這個 - >發送 - 驗證碼>電子郵件

echo $this->email->print_debugger(); 

並檢查您的垃圾郵件,如果電子郵件去那裏