win32com: create email message in windows default app?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Hahn

    win32com: create email message in windows default app?

    Can someone point me in the right direction to tell windows to run the
    default email application, create a new message, and let me populate it with
    subject, body, and attachments? I've been studying win32com.client and I
    think I could use it for a specific application like outlook, but I need it
    to work for any app such as Eudora.


  • News M Claveau /Hamster-P

    #2
    Re: win32com: create email message in windows default app?

    Hi !

    But what is "windows default email application" ?

    In windows, with WSH, you can write :
    Dim str,objEmail
    Set objEmail = CreateObject("C DO.Message")
    objEmail.From = "toto@titi. fr"
    objEmail.To = "tata@tutu. com"
    objEmail.Subjec t = "Msg-try"
    objEmail.Textbo dy = "Corps (body) du (of) message."
    objEmail.Send
    Wscript.quit
    And run, without pb.
    Other way : use MAPI application (essentially outlook-express, or outlook),
    but the "default notion" is bad definition (why MAPI more than CDO or more
    than Python-library ? )

    Windows give sockets and applications use sockets, without priority.
    Applications like yours, virus, trojan, anti-virus, python-scripts, etc.

    -sorry for my poor english-

    @-salutations
    --
    Michel Claveau
    site : http://mclaveau.com


    Comment

    • Mark Hahn

      #3
      Re: win32com: create email message in windows default app?

      [color=blue]
      > But what is "windows default email application" ?[/color]

      I don't know, except that windows applications such as outlook and outlook
      express will ask "Outlook is no longer the default email application, would
      you like to make it the default?". So somebody somewhere inside of windows
      thinks there is a default.

      Also, when you click on a mailto: link in a web browser, only one mail
      message comes up from one mail application, so it must be the default email
      application. How do I get to that default email application and tell it to
      open a message for me?


      Comment

      • Syver Enstad

        #4
        Re: win32com: create email message in windows default app?

        "News M Claveau /Hamster-P" <essai1@mci.loc al> writes:
        [color=blue]
        > Hi !
        >
        > But what is "windows default email application" ?[/color]

        That is the application currently chosen as the mail application in
        Internet Options / Programs. These settings will be used by any
        application that is a Mapi client.

        [color=blue]
        > In windows, with WSH, you can write :
        > Dim str,objEmail
        > Set objEmail = CreateObject("C DO.Message")
        > objEmail.From = "toto@titi. fr"
        > objEmail.To = "tata@tutu. com"
        > objEmail.Subjec t = "Msg-try"
        > objEmail.Textbo dy = "Corps (body) du (of) message."
        > objEmail.Send
        > Wscript.quit[/color]

        You should be equally able to use this with python. Just use
        win32com.client instead:

        Like this:

        import win32com.client
        objEmail = win32com.client .Dispatch('CDO. Message')
        and so on.

        That reason that this works is that CDO uses Mapi behind the scenes.


        --

        Vennlig hilsen

        Syver Enstad

        Comment

        Working...