|
| WD20 - using office365 as mailserver |
| Iniciado por guest, 10,mar. 2016 12:29 - 9 respuestas |
| |
| | | |
|
| |
| Publicado el 10,marzo 2016 - 12:29 |
Hi, one of my clients uses Office365 as their Exchange server. The address is something like https://outlook.office365.com/mapi/emsmdb/…
Currently my application connects to old-fashion Exchange servers using EmailStartSession() But with that office365 address it fails with this error: Connection failed: recipient address not found. Loks like a send-message error, although I am not sending an email yet. Strange...
I also tried EmailStartSMTPSession with no luck.
Can someone tell me how send emails using an Office365 account? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 10,marzo 2016 - 16:27 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 10,marzo 2016 - 21:12 |
Didn't know about the REST API.. That's cool.
Office 365 supports SMTP over SSL so you should be able to use EMailStartSession with the optionSSL in the EmailSessionType variable. I haven't personally done it, but see no reason why it wouldn't work. It would need the user name and password of a licensed mailbox to connect to. This is probably the best option for portability where you want all emails coming from a particular mailbox / address.
Another option would be if the client has Outlook installed, then just use the WD Outlook send functions to send directly from the user's outlook, but then it would be from the user's email address.
Another option would be if they have a static IP and if the Admin of the Office 365 tenant agrees, they could setup a connection from Office 365 to the client site. This is done in Exchange Admin --> Mail Flow --> Connections. And allows unauthenticated SMTP over port 25, but doesn't allow for application portability as IP addresses need coding in Office 365.
Another option would be to forget sending via Office 365 and use a service like mailgun. This solution provides good application portability and is what I use to send notifications and email blasts.. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 11,marzo 2016 - 16:21 |
| I am connecting to office 365 from my windev application and sending emails so I know it is possible. I don't have my code with me right now so I don't have an example handy but I know that I had to use different settings that I was using with google. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 11,marzo 2016 - 20:24 |
Mr Black
I need the first option you are talking about, so the emails will be saved in a particular mailbox. But neither options (ssl.tls) seem to work. I used the credentials of my customer and I suspect now they send me wrong info. I will check that again next week. I prefer using the standard WD mail-functions, because that's 10x faster 
Using the rest-api is also an option, but will cost more time.
@Steve: could you spend a few minutes of your time and find that example for me?
And I just saw it's possible to get a 1 month trial, so I will give that a try next week and keep you informed. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,marzo 2016 - 06:07 |
Hi Arie,
Here is abbreviated example... Hope it helps.
//I am staring session like this.
sEmailSession is string
EmailStartSMTPSession(sEmailAddress,sEmailPassword,sSMTPServer,587,False,emailOptionSecuredTLS)
sEmailSession=sEmailAccount
//Then I'm building email message using email structure (fill in your own info after =)
Email.SenderAddress= Email.Recipient= Email.NbRecipient = Email.Cc= Email.NbCc= Email.Bcc= Email.NbBcc= Email.Subject = Email.HTML =
//Then sending message
IF EmailSendMessage(sEmailSession) = False THEN Error(ErrorInfo(errMessage))
ELSE bMessageSuccessful=True EmailCloseSession(sEmailSession) END |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 14:24 |
Hi Steve,
what address do you use for sSMTPServer? outlook.office365.com smpt.office365.com ?? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 15:18 |
Arie My ISP (British Telecom) uses Office365. I use the following to send/receive emails lsEmailSession..Name = 'My email address' lsEmailSession..Password = 'MyPassword' lsEmailSession..ServerAddress = "smtp.outlook.com" lsEmailSession..Port = "587" lsEmailSession..Option = emailOptionSecuredTLS emailOptionSecuredTLS equates to 1 when viewed in the debugger |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 18:23 |
Quote Arie Mars
Hi Steve,
what address do you use for sSMTPServer?
outlook.office365.com
smpt.office365.com
??
smtp.office365.com |
| |
| |
| | | |
|
| | |
| |
| Publicado el 14,abril 2016 - 18:43 |
Hi guys,
I'm trying to do the same, with WinDev/WebDev with the following code:
UserName is string UserPassword is string
UserName = "TestUser" UserPassword = "123"
// Send an email via the secure SMTP protocol EmailSetTimeOut(10) //10 seconds for the time-out
// Use a secure SMTP server with authentication // Required to use a SMTP // that differs from the one of the ISP
IF EmailStartSMTPSession(UserName, UserPassword, "smtp.office365.com", 587 , False , emailOptionSecuredTLS=True ) = True THEN // Procedure used to initialize the email structure // Start an SMTP session // Build an email Email.Cc="alberto.maggioni@icg-holding.com" Email.NbRecipient=1 Email.Recipient= UserName Email.Sender = UserName Email.SenderAddress=UserName Email.Subject = "Test Office365" Email.Message= "Email test ..." // Sends the email IF EmailSendMessage(UserName) = False THEN Error() END EmailCloseSession(UserName) ELSE Error("Unable to establish connection", ErrorInfo(), ... "In case of time-out, check the parameters of the "+ ... """Firewall"" on the port used (587)") END
but when the istruction IF EmailSendMessage(UserName) .... is executed, after the timeout, appears the following error ...... "content of email.sender not recognized by server. Transaction denied. The last response of SMTP server is: <530 5.7.57 SMTP; Client was not authenticated to send Anonymous mail during MAIL FROM" ....
The UserName and password are valid because I'm able to login inside "https://outlook.office365.com/owa"
Please if someone has still faced this stupid issue, I will appreciate his feedback.
Regards, ciao Alberto |
| |
| |
| | | |
|
| | | | |
| | |
|