Mam problem z wysyłaniem poczty z aplikacji Promotic: konto pocztowe założone jest na office365.com, od administratora zakładowego IT otrzymałem dane-
konto: promotic@nazwa.firmy
Ustawienia pop:
Server name: outlook.office365.com
Port: 995
Encryption method: TLS
Ustawienia smtp:
Server name: smtp.office365.com
Port: 587
Encryption method: STARTTLS
Moje ustawienia w aplikacji
Wykorzystuję standardowy panel z konfiguracją wstępną Email
SendEmail
- Code: Select all
Dim nSendUsing, sFrom, nAuthenticate, sSmtpServer
Dim sUserName, sPassword, nServerPort, bSmtpUseSsl, nConnTimeout
nSendUsing = 2 '1 = Send message using the local SMTP service pickup directory, 2 = Send the message using the network (SMTP over the network)
sSmtpServer = "smtp.office365.com" 'Name or IP of Remote SMTP Server
nAuthenticate = 1 'Type of authentication, NONE=0, Basic=1 (Base64 encoded), NTLM=2
sUserName = "promotic@nazwa.firmy" 'Your UserID on the SMTP server
sPassword = *********** 'Your password on the SMTP server
nServerPort = 587 'Server port (typically 25)
bSmtpUseSsl = true 'Use SSL for the connection (false or true)
nConnTimeout = 60 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
sFrom = "Aplikacja Promotic <promotic@nazwa.firmy>"
pMe.Methods.SendEmailCDO nSendUsing, sSmtpServer, nAuthenticate, sUserName, sPassword, nServerPort, bSmtpUseSsl, nConnTimeout, sFrom, sTo, sSubject, sBody
SendEmailCDO
- Code: Select all
'CDO (Collaboration Data Objects) is a Microsoft technology that is designed to simplify the creation of messaging applications
Dim oMsg, oFlds
Set oMsg = CreateObject("CDO.Message")
oMsg.BodyPart.Charset = "utf-8" ' "windows-1252" or "iso-8859-2" ...
oMsg.Subject = sSubject
oMsg.From = sFrom
oMsg.To = sTo
oMsg.TextBody = sBody
'oMsg.HTMLBody = "<h1>Test email from Promotic..</h1><p>" & sBody & "</p>"
'with file
'oMsg.Addattachment "c:\temp\Text.txt"
Set oFlds = oMsg.Configuration.Fields
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = nSendUsing
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sServer
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = nAuthenticate
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = sName
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = sPass
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = nSrvPort
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = bSsl
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = nTimeout
oFlds.Update
oMsg.Send
Jednak po wysłaniu maila otrzymuję taki komunikat w Info:
SendEmail, Methods: SendEmailCDO, [27,1] Nie powiodło się połączenie warstwy transportu z serwerem.
Próbowałem też zmienić nr portu na 465 tak jak w tym poście
http://www.promotic.eu/forum/viewtopic.php?f=37&t=22331
W tym przypadku nie ma żadnej odpowiedzi, ani też maila na docelowym koncie.
Jedyny pozytywny efekt przynosi zmiana numeru portu na 25.
Próby przeprowadzałem na dwóch różnych komputerach z Win 7 64bit, na Promotic 8.03.08 oraz najnowszej wersji 8.03.18.
Dodam, że to samo konto skonfigurowane pod klientem pocztowym z ustawionym numerem portu 587 i STARTTLS wysyła maile bez problemu.
Proszę o pomoc.
Artur