配置 MantisBT 使用 GMail 发送电子邮件
我是 Mantis 错误跟踪器的新手,我想在注册新帐户后启用电子邮件通知。
好吧,我在本地计算机上正确安装了 MantisBT,没有任何问题,我已经更改了管理员密码并删除了目录中的 admin 文件夹。之后我注册了一个新帐户,出现一条确认消息,说我需要通过电子邮件验证我的注册。我的问题是没有验证消息发送到我的电子邮件。根据我找到的教程之一,我需要首先配置我的 config_inc.php。安装后,我的config_inc.php的初始内容是
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
?>
所以我将其更改为。 *我在这里使用我的 Gmail 帐户
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
$g_allow_signup = ON;
$g_allow_anonymous_login = OFF;
$g_anonymous_account = '';
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = '<[email protected]>';
$g_smtp_password = '<myPass>';
$g_administrator_email = '<[email protected]>';
$g_webmaster_email = '<[email protected]>';
$g_from_name = 'Mantis Bug Tracker';
$g_from_email = '<[email protected]>';
$g_return_path_email = '<[email protected]>';
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;
$g_allow_file_upload = ON;
$g_file_upload_method = DATABASE;
$g_absolute_path_default_upload_folder = '';
$g_max_file_size = 5000000;
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files = '';
$g_disallowed_files = '';
$g_window_title = 'MantisBT';
$g_logo_image = 'images/mantis_logo.gif';
$g_favicon_image = 'images/favicon.ico';
$g_show_realname = OFF;
$g_show_user_realname_threshold = NOBODY;
$g_default_home_page = 'my_view_page.php';
?>
我用这个帐户覆盖我的 config_inc.php,然后注册一个新帐户。提交信息后,出现错误:
致命错误:调用
中未定义的方法 SMTP::getError() myDirectory >\mantis\library\phpmailer\class.phpmailer.php 第 1910 行。
现在我陷入困境,请帮我解决这个问题,我需要设置我的电子邮件通知。我只是创建帐户,但无法使用它们,因为我需要验证它。
如果我需要修改一些相关文件,请告诉我以及步骤是什么。
感谢您的帮助!
I am new to Mantis bug tracker and I want to enable the email notification after registering for a new account.
Well, I installed the MantisBT correctly without any problem on my local computer, I already changed the admin's password and removed the admin folder in the directory. After this I signed up for a new account, there was a confirmation message flashed saying that I need to verify my registration via email. My problem here is that no verification message was sent to my email. According to one of the tutorials I found, I need to configure first my config_inc.php. After the installation, the initial content of my config_inc.php was
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
?>
So I changed it to.
*I am using my gmail account here
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
$g_allow_signup = ON;
$g_allow_anonymous_login = OFF;
$g_anonymous_account = '';
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = '<[email protected]>';
$g_smtp_password = '<myPass>';
$g_administrator_email = '<[email protected]>';
$g_webmaster_email = '<[email protected]>';
$g_from_name = 'Mantis Bug Tracker';
$g_from_email = '<[email protected]>';
$g_return_path_email = '<[email protected]>';
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;
$g_allow_file_upload = ON;
$g_file_upload_method = DATABASE;
$g_absolute_path_default_upload_folder = '';
$g_max_file_size = 5000000;
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files = '';
$g_disallowed_files = '';
$g_window_title = 'MantisBT';
$g_logo_image = 'images/mantis_logo.gif';
$g_favicon_image = 'images/favicon.ico';
$g_show_realname = OFF;
$g_show_user_realname_threshold = NOBODY;
$g_default_home_page = 'my_view_page.php';
?>
I overwrite my config_inc.php with this one and then register for a new account. After submitting the information, an error occured saying:
Fatal error: Call to undefined method SMTP::getError() in < myDirectory >\mantis\library\phpmailer\class.phpmailer.php on line 1910.
And now I'm stucked, please help me with this, I need to setup my email notification. I was just creating accounts but I cannot use them because I need to verify it.
Please let me know if I need to modify some of the related files and what are the steps.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
根据 MantisBT 论坛上的帖子,这些是GMail 的工作设置:
According to a posting on the MantisBT forums, these are working settings for GMail:
关于 GMail 有一些补充。这些设置是正确的,但 GMail 制定了一些新的安全措施,仍然可以防止从 Mantis 或任何其他使用 SMTP 连接器的邮件程序发送电子邮件。
要使用 GMail 执行此操作,您必须“允许安全性较低的应用访问帐户” 。在GMail管理中,有一个设置允许用户控制来自“不太安全的应用程序”的访问,必须打开该设置,然后用于发送邮件的用户帐户必须打开来自“不太安全的应用程序”的访问。上面的链接提供了有关如何配置它的信息。
令人沮丧的是,一切看起来都工作正常,但没有发送任何电子邮件。 SMTP 服务器没有错误指示。但是,用于发送邮件的用户帐户可能会收到来自 GMail 的电子邮件,表明有人正在尝试访问该帐户。我花了几个小时试图找出这一点。
Something to add about GMail. These settings are correct but GMail has instituted some new security that will still prevent email from being sent from Mantis or any other mailer using the SMTP connector.
In order to do this with GMail, you must "Allow less secure apps to access accounts". In GMail admin, there is a setting to allow users to control access from "less secure apps," which must be turned on, and then the user account used to send mail must turn on access from "less secure apps." The link above provides the information on how to configure this.
The frustrating thing is everything will appear to work fine but no emails are sent. There is no error indication from the SMTP server. However, the user account used to send mail may receive an email from GMail indicating someone is trying to access the account. I spent hours trying to track this down.
如果有人在配置时仍然遇到问题或错误,请添加日志级别,以便您可以进一步深入了解问题。以下设置对我有用。详细解释写在这里
If anyone still faces issue or error while configuration add log level so that you can drill down the problem further. Below settings worked for me. Detailed explanation is written here
它对我有用
it Works for me
2017 更新 (MantisBT 2.3.0) 请按照以下步骤操作:
[1] 如果您使用 DOCKER
访问运行以下命令的 docker 实例:
[2] INSIDE MANTISBT SERVER(
如果您没有)编辑器:
创建一个日志文件:
[3] EDITING MANTISBT CONFIGURATION
将以下内容添加到前面步骤中打开的文件中:
[4] EDITING GMAIL CONFIGURATION
您需要执行以下操作这是为了允许 MantisBT 身份验证:
访问以下 URL:
https://myaccount.google.com
导航至登录页面菜单树下的安全菜单项。
选中“允许安全性较低的应用程序”选项并将其设置为 true
Image :
一切顺利!
使用这些配置进行测试和运行。 =]
2017 update (MantisBT 2.3.0) Please follow the steps below:
[1] IF YOU'RE USING DOCKER
Access the docker instance running the command below:
[2] INSIDE MANTISBT SERVER
if you dont have any editor:
create a log file:
[3] EDITING MANTISBT CONFIGURATION
add the following content to the file opened in the earlier step:
[4] EDITING GMAIL CONFIGURATION
You need to do this in order to allow MantisBT authentication:
Access the following URL:
https://myaccount.google.com
Navigate to the Sign-in & Security menu-item under menu-tree.
Check the "Allow less secure apps" option and set equals to true
Image:
You're good to go!
Tested and running with these configurations. =]
我的问题通过更新 ca 证书得到解决。
我正在 Windows 服务器 2012 上使用 Xampp 和 PHP 7.2。
虽然下面的链接为您提供了详细信息,但我也提到了相关部分:
https://github.com/ PHPMailer/PHPMailer/wiki/Troubleshooting#updating-ca-certificates
My issue was solved by updating ca certificates.
I am using Xampp, with PHP 7.2 on Windows sever 2012.
Although the below link provides you with the details, I mention the relavent part too:
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#updating-ca-certificates