Share via

using CDOSYS to send email via SMTP

Anonymous
2017-04-19T06:38:31+00:00

Split from this thread.

I have run into the SAME issue.

I am using a LICENCED mailbox user/passw to attempt to submit email to 365

The CONFIGURATION settings are:

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    '// set timeout - default = 30 seconds

    'objMessage.Configuration.Fields.Item _

    '("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30

    '// name or IP of remote server

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com"

    '// Server port (typically 25)

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587

    '// Use TLS (AKA SSL)

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

    '// turn on authentication

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

    '// username

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = SENDusername

    '// password

    objMessage.Configuration.Fields.Item _

    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SENDpassword

    '// update the message configuration

    objMessage.Configuration.Fields.Update

    '// send the message

    objMessage.Send

And BEFORE anyone asks; the variables SENDusername and SENDpassword DO contain VALID account details (set elsewhere in the script)...

What I have determined.

1/ I can telnet to:

         smtp.office365.com 587

     and

         smtp.office365.com 25

2/ If I set the port to 25 it works..

I'm on windows 10 (latest)

The CDO.Message library does appear to have a bug and NOT support using port 587  !!!!

All the best

David (Nobby) Barnes

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2017-04-19T08:29:19+00:00

    Hi David,

    Are you using SMTP client submission in this article?

    Since you can telnet to: smtp.office365.com 587 and smtp.office365.com 25, your Office 365 SMTP service is ok. Please make sure that you have met the following requirements:

    1.Authentication: You must be able to configure a user name and password to send email on the device.

    2.Mailbox: You must have a licensed Office 365 mailbox to send email from.

    3.Transport Layer Security (TLS): Your device must be able to use TLS version 1.0 and above.

    4.Port: Port 587 (recommended) or port 25 is required and must be unblocked on your network. Some network firewalls or ISPs block ports—especially port 25.

    If you have met all the requirements but it still doesn’t work, the issue might be related to CDO. You may need to contact CDO to check if it supports Office 365 SMTP client submission.

    If SMTP client submission is not supported, you can also try SMTP relay in this article to see if it works.

    Regards,

    Monique

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-04-28T19:57:54+00:00

    Hi David,

    CDO is a third-party service to Office 365. You can contact them through the way that you get CDO. And there might be any instruction book about CDO for your reference.

    Regards,

    Monique

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-04-28T12:38:35+00:00

    who would I contact (forum) for CDO bug/help?

    it should work, but refuses on port 587.

    in fact network trace shows it seems to incorrectly negotiate the connection ehlo starttls process.

    Thanks

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-04-28T12:38:18+00:00

    who would I contact (forum) for CDO bug/help?

    it should work, but refuses on port 587.

    in fact network trace shows it seems to incorrectly negotiate the connection ehlo starttls process.

    Thanks

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-04-21T09:29:46+00:00

    Hi David,

    Do you need further assistance? Please share any update at your convenience.

    Regards,

    Monique

    Was this answer helpful?

    0 comments No comments