Send email with attachment in Outlook

  • In my program I'm using CDO to send my emails using Gmail and Yahoo mail. The variables & everything work perfectly. I'm trying to use the same code with (smtp-mail.outlook.com) to send using Outlook. My app will be used by several people (millions hopefully..lol) with varied providers. I'm using IF_THEN to determine providers chosen by the operator on the home input sheet. All seems to go fine until it tries to SEND. Run Time Error 80040211 - The message could not be sent to SMTP server - Transport Error Code )x80040217 - Server response not available.
    I've got "allow less secure" on my google settings. Do I need to find this in Outlook somewhere? Here's a copy of my code



    I'm sure that this could be streamlined (will get help later with this from someone with more knowledge), but should be ok for now...I need to develop this
    Any help will be greatly appreciated
    Thanks...Jim

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • If found no error. Of course I commented out the calls to other routines.


    You can also use the outlook server smtp.offfice365.com.


    Unless you are sending only to yourself, attaching a copy of the workbook with login information would be a very bad idea.

  • Thanks Kenneth but the smtp.office365.com didn't work either...Sheesh, I feel like I've tried everything. (obviously not) Now I don't have office 365 downloaded to my sys. Would that matter?
    Also Very Good recommendation about sending out login info. All my macros will be password protected but there's some info on the 'Default Sheet'. I'll make sure any such info is password protected as well.
    Not sure what to try next...will go on and come back to it later...Spending too much time on it :(

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)