Jump to content

Recommended Posts

Posted

I'm using the updated _INetSmtpMailCom function Jos provided.  For some reason, I'm not able to get a basic text email (or any email, for that matter) to send via an Office365 email account.  I tried the same user/pass/port/ssl settings in PowerShell and can successfully send a test email.  When I use Amazon SES as a proxy, it also sends correctly.

When I send with what should be the correct settings (app password, port 587, TLS=True), I get the error: "The server rejected the sender address. The server response was: 451 5.7.3 STARTTLS is required to send mail"

I have tried every combination I can think of: TLS, no TLS, SSL, no SSL, app password, regular password, ports 25, 465, and 587...nothing is working.  I have the attached code as the line handling the TLS setting.  Has anyone else run into this?  Does the code need to be updated?

Any help is appreciated!

If $tls Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True

 

  • Developers
Posted (edited)

Just tested and works fine with my O365 account as defined somewhere in the thread: :) 

I have added some comments in the first post of the examples thread now.

;
;##################################
; Include
;##################################
#Include<file.au3>
;##################################
; Variables
;##################################
$SmtpServer = "MailServer"              ; address for the smtp-server to use - REQUIRED
$FromName = "Name"                      ; name from who the email was sent
$FromAddress = "your@Email.Address.com" ; address from where the mail should come
$ToAddress = "your@Email.Address.com"   ; destination address of the email - REQUIRED
$Subject = "Userinfo"                   ; subject from the email - can be anything you want it to be
$Body = ""                              ; the messagebody from the mail - can be left blank but then you get a blank mail
$AttachFiles = ""                       ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed
$CcAddress = "CCadress1@test.com"       ; address for cc - leave blank if not needed
$BccAddress = "BCCadress1@test.com"     ; address for bcc - leave blank if not needed
$Importance = "Normal"                  ; Send message priority: "High", "Normal", "Low"
$Username = "******"                    ; username for the account used from where the mail gets sent - REQUIRED
$Password = "********"                  ; password for the account used from where the mail gets sent - REQUIRED
$IPPort = 25                            ; port used for sending the mail
$ssl = 0                                ; enables/disables secure socket layer sending - put to 1 if using httpS
$tls = 0                                ; enables/disables TLS when required
;~ $SmtpServer = "smtp.gmail.com"       ; GMAIL address for the smtp-server to use - REQUIRED
;~ $IPPort=465                          ; GMAIL port used for sending the mail
;~ $ssl=1                               ; GMAIL enables/disables secure socket layer sending - put to 1 if using https
;~ $SmtpServer = "smtp.office365.com"   ; O365 address for the smtp-server to use - REQUIRED
;~ $IPPort=25                           ; O365 port used for sending the mail
;~ $ssl=1                               ; O365 enables/disables secure socket layer sending - put to 1 if using https
;~ SmtpServer = "smtp.mail.yahoo.com"   ; Yahoo address for the smtp-server to use - REQUIRED
;~ $IPPort = 465                        ; Yahoo port used for sending the mail
;~ $ssl = 1                             ; Yahoo enables/disables secure socket layer sending - put to 1 if using https

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Thank you, Jos.  I think it may have something to do with the fact I got the O365 addresses through GoDaddy.  It will let me use smtpout.secureserver.net, but not smtp.office365.com.  When you do it through secureserver though, it only supports 5 whole relays per 24 hours 😂

Anyway, thank you for the help.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...