Subject line with smtplib.sendmail()

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 21 00:07:03 CET 2007


En Tue, 20 Mar 2007 15:18:01 -0300, Boudreau, Emile  
<Emile.Boudreau at cognos.com> escribió:

> Sorry folks. Scrape the last one that I sent. I noticed that it sends
> the email perfectly if the code is not in any of my methods but the
> second I insert it into a method I get the ugly email that I described
> in my last email.
>
> Does anyone know how I can get this code in my method so that I have
> access to all the variables I have?

I don't understand exactly what you mean, but looking at your example:

>
> Working.on at server.com
> To:
> ------------------------------
> 	From: Working.On at server.com
> 	To: Emile.Boudreau at server.com
> 	Subject: Hello!
>
> 	This Still DOESN't Work!!!!!!!!!!!!
> 	
> It's just adding the "From" "To" "Subject" in the message itself. I want
> to have each field at the correct place and then just the msg in the
> body.

	Perhaps you are using an """indented
	triple quoted
	string""" ?

The indentation goes into the string itself. You may use a global (module)  
constant to hold the string, by example.

-- 
Gabriel Genellina




More information about the Python-list mailing list