473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 18 '05 #1
3 4069
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 = "to**@titi. fr"
objEmail.To = "ta**@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
Jul 18 '05 #2
But what is "windows default email application" ?


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?
Jul 18 '05 #3
"News M Claveau /Hamster-P" <es****@mci.loc al> writes:
Hi !

But what is "windows default email application" ?
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.

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


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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5193
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly remove old version (as well as the mx libraries I had installed). I then installed the new version as a user with the Administrator role. I know I'm technically not supposed to install to a directory with a space in the name, but it worked fine for...
1
3266
by: Patrick | last post by:
I am investigating a web-based app wherein I wanted to provide html form frontends to an Excel spreadsheet sitting on a MS Windows server; with each authenticated HTTP user having thier own "invisible" copy of the spreadsheet changeable via form POST via COM automation object (via Python) - then after recalculating - present the spreadsheet results in HTML. The whole idea to 1: isolate the user from having to have Excel, and 2: avoiding...
2
7099
by: Sibylle Koczian | last post by:
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But now I can't _use_ win32com as a normal user, because normal users can't write there: PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32. Portions Copyright 1994-2004 Mark Hammond (mhammond@skippinet.com.au) -
1
9175
by: g.franzkowiak | last post by:
I'm trying to use a proprietary windows software with COM and win32com. The result is everytime the error message com_error: (-2147418113, 'Catastrophic failure', None, None) I've read this in some e-mails, but can't find the solution and I have not enough experience with Windows and COM. Can anybody help ?
7
8869
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
1
1813
by: Sergey | last post by:
import win32com.client loc = win32com.client.Dispatch("WbemScripting.SWbemLocator") svc = loc.ConnectServer("srv", "root/cimv2", "Admin@zzz.ru", "******") sys = svc.get("Win32_Process") sys.create("notepad.exe") => Traceback (most recent call last):
3
6958
by: tyler.schlosser | last post by:
Hi there, I am trying to launch a program called AmiBroker using the command: AB = win32com.client.Dispatch("Broker.Application") However, I have a dual-core CPU and would like to launch two instances of AmiBroker. I know it is possible to run two instances simultaneously since it is easy to do manually by double-clicking the AmiBroker.exe file twice. However, when I write two lines of code like this:
12
129996
by: vithi | last post by:
Hi Any one tell me where I can get (or download) python modules win32com or win32com.client because I have to use "Dispatch" thanks
11
7740
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.