Cannot form correctly the FORM part of the header when sending mail

Ferrous Cranus nikos at superhost.gr
Thu Sep 5 05:34:43 EDT 2013


Even though these examples are with ints, not strings, the precedence is
the same.

Go back to your code. Read your code. Does it look closer to this:

8 + 2 % 5

or this?

(8 + 2) % 5


Can you solve this problem now?

Yes Steven, according to your precedence example now i can:

MESSAGE = ( "From: %s\n" + "To: %s\n" + "Subject: %s\n\n%s\n" ) % ( 
FROM, TO, SUBJECT, MESSAGE )
			MESSAGE = MESSAGE.encode('utf-8')



it just need the whole concatenation thing in parenthesis so to be 
executed first but now:


			# send the mail
			server.sendmail( [ MESSAGE ] )

or

			# send the mail
			server.sendmail( MESSAGE )

both fail.



More information about the Python-list mailing list