473,396 Members | 1,775 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,396 software developers and data experts.

smtplib question


how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.

but if i also add the "Cc" folks to the list of recipients in the call to smtplib.sendmail(),
it arrives at their mailer with their address listed on both the "To" and "Cc"
header fields.

what i want is for everyone on the "To" or "Cc" list to get the mail, and for
the mail headers to reflect this.

please respond off-list. i had to give up following comp.lang.python for lack
of time.

thanks

----
Garry Hodgson, Technology Consultant, AT&T Labs

Be happy for this moment.
This moment is your life.

Jul 18 '05 #1
2 4844
Garry Hodgson wrote:

how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.


oops. please ignore this. it was just a dumb mistake on my part.

--
Garry Hodgson Those who would give up essential
liberty
Senior Hacker to purchase a little temporary safety
Software Innovation Services deserve neither liberty nor safety.
AT&T Labs
ga***@sage.att.com - Benjamin Franklin, 1775
Jul 18 '05 #2
Garry Hodgson <ga***@sage.att.com> wrote:

how do i use smtplib to send mail to someone with "cc" to someone else?
if i just include the "to" addressees in the call to smtplib.sendmail(), and
put the others in the "Cc" header fields, only the "To" recipients get the mail,
thought the mail headers look right.
The e-mail headers (To:, Cc:, Subject:, etc.) are not part of SMTP. They
are ignored by sendmail and play no part at all in the e-mail delivery.
The only thing sendmail cares about is the list of addresses in the SMTP
protocol, which comes from the first parameter to smtplib.sendmail.

So, the short answer is that the address list (first parameter to
smtplib.sendmail) must include EVERYONE that should receive the message --
To, Cc, or Bcc -- in one big list. You can put whatever you want in the
headers in the body of the message; it won't matter. For large lists, it
is common for the header to say, for example:

To: recipient list suppressed

Perfectly legal.
please respond off-list. i had to give up following comp.lang.python for lack
of time.


But yet, you expect us to take OUR time to answer your questions for free?
That doesn't seem right.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #3

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

Similar topics

9
by: Bill | last post by:
I am trying to have the capability to email attachments. Specifically I want to be able to email a specific attachment that I name that may be a PDF document, text doc, etc. I already have a...
0
by: David Geller | last post by:
Hi, I had been using smptlib to send email via my covad relay previously (several months ago), and it worked fine. Covad requires authentication, and this was accomplished fine with...
0
by: Tim Williams | last post by:
I have a working SMTP client that I need to add TLS capability to, I absolutely need the client to timeout within a specified time, but when I use the sock.timeout() line it freezes the reading...
12
by: Chris Dewin | last post by:
Hi. I've been thinking about using smtplib to run a mailing list from my website. s = smtplib.SMTP("server") s.sendmail(fromaddress, toaddresess, msg) I know that in this instance, the...
7
by: nephish | last post by:
Hey there, i am using the smtplib module in python 2.3 my question is, this works: server = smtplib.SMTP(localhost) then server.sendmail(to address, from address, message)
3
by: Van_Gogh | last post by:
Hi, I am learning how to use the smtplib module, but am having some very early problems, maybe because I don't understand it. So, am I correct that by following the example in the Python: >>>...
8
by: NicolasG | last post by:
I'm using the following code to send e-mail through python: import smtplib fromaddr = 'myMail@gmail.com' toaddrs = 'myOtherMail@gmail.com' subject = 'someting for subject !' msg = 'This...
0
by: Roger | last post by:
I am having a problem sending email through smtp.gmail.com using smtplib. Everything works and the mail is sent and received, except quit. The following shows the problem (without bothering to...
5
by: zxo102 | last post by:
Hi, I am trying to use python module smtplib to send my email out on window xp (localhost). import smtplib server = smtplib.SMTP('localhost') but I got the error information as follows: ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.