473,289 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

send email

Hello:

Could you tell me How I can send an email using WIN2000? What do I need?

Thanks
Jul 18 '05 #1
3 6111
"Alberto Vera" <av***@coes.org.pe> wrote in message news:<ma*********************************@python.o rg>...
Hello:

Could you tell me How I can send an email using WIN2000? What do I need?


Using Python, I supose...

http://www.python.org/doc/current/li...e-smtplib.html
--
David.
Jul 18 '05 #2
Your other option, assuming you don't mind Windows specific code, is to use the CDONTS COM library:

import win32com.client
def SendEmail(emailAddresses, subject, body, files):

iConf = win32com.client.Dispatch("CDO.Configuration")
Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value = "someserver"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value = 25
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing").Value = 2 # cdoSendUsingPort
# Authentication and stuff
Flds('http://schemas.microsoft.com/cdo/configuration/smtpauthenticate').Value = 0 # No authentication
# The following fields are only used if the previous authentication value is set to 1 or 2
# Flds('http://schemas.microsoft.com/cdo/configuration/smtpaccountname').Value = "user"
# Flds('http://schemas.microsoft.com/cdo/configuration/sendusername').Value = "domain\\user"
# Flds('http://schemas.microsoft.com/cdo/configuration/sendpassword').Value = "password"
Flds.Update()
iMsg = win32com.client.Dispatch("CDO.Message")
iMsg.Configuration = iConf
iMsg.To = ";".join(emailAddresses)
iMsg.From = "Test<te**@test.com>"
iMsg.Subject = subject
iMsg.TextBody = body
# The following assumes the files to be in the current directory
for file in files:
iMsg.AddAttachment("file:///" + os.getcwd() + "/" + file)
iMsg.Send()

Felix.

Hello:

Could you tell me How I can send an email using
WIN2000? What do I need?

Thanks

Jul 18 '05 #3
Alberto Vera wrote:
Hello:

Could you tell me How I can send an email using WIN2000? What do I need?

Thanks


Why don't you try the following:

##### start of script #######
from email.MIMEText import MIMEText
import smtplib

myVar = 'result of previous action'

body='''this text will become the body of the message
Using triple-quotes you can span it easily over multiple lines.
You can also add the value of variables in it: %s .
This can come in handy if you want to mail
the result of an action''' % (myVar)

msg = MIMEText(body)
From = "my***@myServer.net"
To = "wh*******************@mydomain.org"
CC = "so**********@mydomain.org"
msg['From'] = From
msg['To'] = To
msg['Cc'] = CC
msg['Subject'] = "Don't leave me empty please"

server = smtplib.SMTP("mailserver.mydomain.org")
server.sendmail(From,[To,CC],msg.as_string())
server.quit

###### end of script #####

Jul 18 '05 #4

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

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
0
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
8
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.