problems with e-mails

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
dadomaz83
Posts: 2
Joined: 22 Aug 2016, 14:08

problems with e-mails

Post by dadomaz83 »

Hello,

like many users, i have some problems in sending e-mails with Mantis BT..

my "Root\mantisbt\config\config_inc.php" has the following configuration, about e-mails:
$g_enable_email_notification = ON;
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.xxxx.yyyy.it';
$g_smtp_connection_mode = '';
$g_smtp_port = 25;
$g_smtp_username = '';
$g_smtp_password = '';
$g_webmaster_email = 'xxxxxx@yyyy.it';
$g_from_email = 'xxxxxx@yyyy.it';
$g_return_path_email = 'xxxxxx@yyyy.it';
$g_from_name= 'Bug Tracking';

I have tried on a php executable, to send e-mails using php mailer:
<?php
require_once ('../Program Files/PHP/v7.0/vendor/phpmailer/phpmailer/PHPMailerAutoload.php');
require_once ('../Program Files/PHP/v7.0/vendor/phpmailer/phpmailer/class.phpmailer.php');

$mail = new PHPMailer;

$mail->isSMTP();
$mail->Host = "smtp.xxxx.yyyy.it";
$mail->SMTPSecure = false;
$mail->SMTPAuth = false;
$mail->SMTPDebug = 2;
$mail->SetFrom ("xxxxxx@yyyy.it", "Strutture");
$mail->AddReplyTo("xxxxxx@yyyy.it","Strutture");
$mail->Port = 25;
$mail->SMTPAutoTLS = false;
$mail->Subject = "PHPMailer Test Subject via smtp, basic with no authentication";
$mail->Body = "This is SMTP Email Test";

$address = "xxxxxx@yyyy.it";
$mail->AddAddress($address, "Prova");

if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
?>

And it works, it send perfectly the e-mail.


Please, i need your help, to understand what i'm missing...

thank you very much,
Davide

p.s.
i have put:
$g_smtp_connection_mode = '';

since email sending on my server works just if i put:
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
Mantis: 1.3
PHP: 7.0
IIS 7
SQL: MySQL 5.0.51a
OS: Win Server 2008 R2
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: problems with e-mails

Post by atrol »

Please use Search before posting and read the Manual
dadomaz83
Posts: 2
Joined: 22 Aug 2016, 14:08

Re: problems with e-mails

Post by dadomaz83 »

thank you very much! now, with the solution suggested in the link, it works! :P
Mantis: 1.3
PHP: 7.0
IIS 7
SQL: MySQL 5.0.51a
OS: Win Server 2008 R2
Post Reply