這是我在控制器sendmail的功能localhost Wamp可以發送電子郵件給其他郵件服務器?
public function sendmail()
{
$this->load->model("common_model");
$admin = $this->common_model->get_admin('email,name');
$this->load->library('email');
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from($_POST['emailId'], $_POST['firstName']);
$this->email->to($admin[0]->email);
$this->email->subject('User Registered For Model :'.base_url());
$message ="<html> \r\n";
$message .="<body> \r\n";
$message .="<table border='0' cellpadding='3' cellspacing='2'>
<tr><td align='left' colspan='2'>Contact Form:-</td></tr>
<tr><th colspan='2'> </th></tr>
<tr><th>Name: </th><td>: ".$_POST['firstName']."</td></tr>
<tr><th>City: </th><td>: ".$_POST['address']."</td></tr>
<tr><th>Email: </th><td>: ".$_POST['emailId']."</td></tr>
<tr><th>Phone: </th><td>: ".$_POST['mobile']."</td></tr>
<tr><th colspan='2'> </th></tr>";
$message .= "</table> \r\n";
$message .= "</body> \r\n";
$message.="</html> \r\n";
$this->email->message($message);
$this->email->send();
redirect('myaccount',$data);
}
我使用的是WAMP的服務器,這是WAMP服務器
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =
的設置我已經做了什麼樣的變化將郵件發送到另一臺服務器? 或我的函數中有一些錯誤。所以我不能發送郵件到其他郵件服務器?