473,378 Members | 1,500 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,378 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 6120
"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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.