I'm new to Mantis and PHP and I've gotten pretty far with email setup but it's still not working.
I am able to send email directly through a sendmail() test program (shown below) using the same credentials
I'm also able to send via c# using the .net smtp library so I'm pretty sure my gmail security is working properly.
I'm aware what I posted says _SMTP but I've also tried _SENDMAIL. Neither work for me.
Mantis itself runs fine, it's now just the email configuration. that's got me stumped.
I have read all the posts, including the one that is 10 year's old on using Mantis with gmail. Maybe it's still current but I'm not certain.
Thanks in advance for your help,
Peter
MantisBT 2.23.0
PHP 7.4.2
MySQLi 10.4.11
SendMail.ini
Code: Select all
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
error_logfile=error.log
debug_logfile=debug.log
auth_username=myname@gmail.com
auth_password=xxxxxxxxxxxxxxxx
force_sender=myname@gmail.com
Code: Select all
[mail function]
SMTP=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
auth_username=myname@gmail.com
auth_password=xxxxxxxxxxxxxxxx
sendmail_from = myname@gmail.com
sendmail_path = C:\xampp\sendmail
Code: Select all
$g_allow_signup = OFF; //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_smtp_username = 'myname@gmail.com'; //replace it with your gmail address
$g_smtp_password = 'xxxxxxxxxxxxxxxxxx"; //replace it with your gmail password
$g_return_path_email = 'myname@gmail.com'; //this will be your administrator email address
$g_administrator_email = 'myname@gmail.com'; //this will be your administrator email address
$g_webmaster_email = 'myname@gmail.com'; //this will be your administrator email address
$g_email_send_using_cronjob = OFF;
$g_email_receive_own = ON;
$g_debug_email = ON;
$g_from_email = 'myname@gmail.com'; //this will be your administrator email address
$g_from_name = 'IA Bugtracker';
$g_log_level = LOG_EMAIL | LOG_EMAIL_VERBOSE;
$g_log_destination = 'file:c:\temp\mantisEmail.log';
$g_validate_email = ON;
Code: Select all
2020-02-08 11:36 EST MAIL_VERBOSE email_queue_api.php:127 email_queue_add() message 17 queued
2020-02-08 11:36 EST MAIL email_api.php:576 email_send_confirm_hash_url() Password reset for user @U4 sent to pnirenberg.ids@gmail.com
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:2092 email_shutdown_function() Shutdown function called for /mantis/manage_user_reset.php (email processing forced)
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:1208 email_send_all() Processing e-mail queue (2 messages)
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:1219 email_send_all() Sending message 16
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:1354 email_send() Using debug email '1'
2020-02-08 11:36 EST MAIL email_api.php:1361 email_send() ERROR: Message could not be sent - Invalid address: (to): 1
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:1219 email_send_all() Sending message 17
2020-02-08 11:36 EST MAIL_VERBOSE email_api.php:1354 email_send() Using debug email '1'
2020-02-08 11:36 EST MAIL email_api.php:1361 email_send() ERROR: Message could not be sent - Invalid address: (to): 1
Code: Select all
<?php
$to_email = 'myname@gmail.com';
$subject = 'Testing PHP Mail';
$message = 'This mail is sent using the PHP mail function';
$headers = 'From: myname@gmail.com';
mail($to_email,$subject,$message,$headers);
?>