【问题标题】:localhost Wamp can send email to other mail sever?localhost Wamp 可以向其他邮件服务器发送电子邮件吗?
【发布时间】:2013-11-11 04:50:44
【问题描述】:

这是我在控制器中的发送邮件功能

    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'>&nbsp;</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'>&nbsp;</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 = you@yourdomain

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

为了将邮件发送到其他服务器,我做了哪些更改? 或我的功能中的一些错误。所以我不能向其他邮件服务器发送邮件?

【问题讨论】:

    标签: php codeigniter email wamp wampserver


    【解决方案1】:

    您需要指定一个 SMTP 服务器来路由 localhost 发送的电子邮件。如果您的机器上没有安装 SMTP 服务器,localhost 不是一个好的值。相反,您应该放置您的互联网提供商的 SMTP 服务器。

    【讨论】:

      【解决方案2】:

      WAMP 无法发送电子邮件。尝试使用 Test Mail Server Tool 测试从 localhost 发送的邮件

      【讨论】:

        猜你喜欢
        • 2014-05-20
        • 2011-08-12
        • 2014-08-12
        • 2017-02-19
        • 2014-04-19
        • 2020-03-09
        • 2020-04-19
        • 2014-11-14
        • 1970-01-01
        相关资源
        最近更新 更多