2016-12-31 55 views
-2
$config = Array(
    'protocol' => 'smtp', 
    'smtp_host' => 'smtp.googlemail.com', 
    'smtp_port' => 587, 
    'smtp_user' => '[email protected]', 
    'smtp_pass' => 'password', 
    'mailtype' => 'html', 
    'charset' => 'iso-8859-1' 
); 

$this->email->from('[email protected]', 'easyfact'); 
$this->email->to('[email protected]'); 
$this->email->cc('[email protected]'); 
$this->email->bcc('[email protected]'); 
$this->email->subject('Email Test'); 
$this->email->message('Testing the email class.'); 
$this->email->send(); 
echo $this->email->print_debugger(); 

reulst網站發送電子郵件笨3不靈本地主機使用wamppserver

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() 

Unable to send email using PHP mail(). Your server might not be configured to send mail using this method. 

我使用wamppserver HELF我

回答

0

您沒有使用$config變量的任何地方。致電

$this->email->initialize($config); 

這應該可以解決您的問題。

參見:笨電子郵件類文檔的Setting Email Preferences一部分。

+0

無法發送AUTH LOGIN命令。錯誤:530 5.7.0必須首先發出STARTTLS命令。 v1sm128263817pgv.33 - gsmtp 無法使用PHP SMTP發送電子郵件。您的服務器可能未配置爲使用此方法發送郵件。 –

+0

看到這個問題和答案https://stackoverflow.com/questions/29972179/unable-to-send-email-using-php-mail-your-server-might-not-be-configured-to-se – Finwe