EricCar

  • 5 days ago
  • Joined Dec 12, 2023
  • 1 discussion
  • 1 post
  • 0 best answers
  • Post posted... wait what?
  • I want to send an email with a powershell script to mailcow.

    the script below works in 587 but not in 465 ?

    $from = "myname@mydomaine.com"
    $to = "info@domaine.com"
    $smtp = "mail.mydomaine.com"
    $sub = "test"
    $body = "test mail"
    $secpasswd = ConvertTo-SecureString "mypassword" -AsPlainText -Force
    $mycreds = New-Object System.Management.Automation.PSCredential($from, $secpasswd)
    Send-MailMessage -To $to -From $from -Subject $sub -Body $body -Credential $mycreds -SmtpServer $smtp -Port 587 -UseSsl -BodyAsHtml

    On the same machine Thunderbird sends emails on port 465, and it works.

    Do you have any idea of ​​the problem, on mailcow I can’t find an error in the logs, or I’m not looking in the right place

    Thanks for your advices