How to configure php.ini to use gmail as mail server

前端 未结 4 1296
野趣味
野趣味 2021-02-04 10:50

I want to learn yii as my first framework. And I\'m trying to make the contact form work. But I got this error: \"alt

4条回答
  •  不要未来只要你来
    2021-02-04 11:31

    1. uncomment extension=php_openssl.dll at php.ini in WAMP server ("D:\wamp\bin\apache\Apache2.4.4\bin\php.ini")

    2. In the file "D:\wamp\www\mantisbt-1.2.15\config_inc.php"

        # --- Email Configuration ---
    
        $g_phpMailer_method = PHPMAILER_METHOD_SMTP; 
        $g_smtp_host = 'smtp.gmail.com';
        $g_smtp_connection_mode = 'ssl';
        $g_smtp_port = 465;
        $g_smtp_username        = 'yourmail@gmail.com'; 
        $g_smtp_password        = 'yourpwd';
        $g_enable_email_notification = ON;
        $g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
        $g_log_destination = 'file:/tmp/log/mantisbt.log';  
        $g_administrator_email  = 'administrator@example.com';
        $g_webmaster_email      = 'webmaster@example.com';
        $g_from_email           = 'noreply@example.com';
        $g_return_path_email    = 'admin@example.com';  
        $g_from_name            = 'Mantis Bug Tracker';
        $g_email_receive_own    = OFF;
        $g_email_send_using_cronjob = OFF;
    

提交回复
热议问题