You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-04-08 13:35:58

AndreuGoNi
Member
Registered: 2023-10-24
Posts: 5

Error sending test email

Good afternoon, I just created a server with Windows Server to run a glpi for testing. The problem is that I can't get it to send the test notification via email.
I get the following error when I press the button: "Failed to send a test email to the administrator."

I have checked the data and everything is fine.

Admin email: Ok
Email sender address: Ok
Email sending method: SMTP+TLS
SMTP Server: Ok
Port: 25
SMTP access: Ok
SMTP Password: Ok

Email sender: Ok

The versions of what I have installed are:
Windows Server 2022
MySQL: 8.0
Php: 8.2.11
GLPI: 10.0.14


Another clue:
I have executed this code via Powershell and it works correctly. (With the data that I put in the glpi)

# Parameter Settings
$smtpServer = "smtp.yourdomain.com"
$smtpPort = 25 # Port SMTP TLS
$smtpUsername = "user"
$smtpPassword = "password"
$fromAddress = "your_email@yourdomain.com"
$toAddress = "addressee@domain.com"
$subject = "Email subject"
$body = "Email body"

# Create object to send mail
$mail = New-Object System.Net.Mail.MailMessage
$mail.From = $fromAddress
$mail.To.Add($toAddress)
$mail.Subject = $subject
$mail.Body = $body

# Configure the SMTP client
$smtp = New-Object System.Net.Mail.SmtpClient($smtpServer, $smtpPort)
$smtp.EnableSsl = $false # Enable TLS
$smtp.Credentials = New-Object System.Net.NetworkCredential($smtpUsername, $smtpPassword)

# Send email
$smtp.Send($mail)

Write-Host "Email sent successfully."

What else can I look at/try? In principle everything else about glpi works without problems.


Thanks for your attention

Offline

Board footer

Powered by FluxBB