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

Ferrous Cranus nikos at superhost.gr
Fri Sep 6 02:44:40 EDT 2013


Στις 6/9/2013 7:48 πμ, ο/η Piet van Oostrum έγραψε:
> hotmail.com. Register this as one of your email addresses in
>    gmail. For this it must be a real email address that belongs to you,
>    not a fake address. When it is registered with gmail, gmail will not
>    change it if found in a From header.

Hello Piet,

I'am not sure what you mean by registering a mail address with GMail.
Do you mean to add more that one mail account addresses within my GMail 
account?

If you mean that i must tell you that in the pop settinsg inside my 
gmail.com account i use nikos at superhost.gr and nikos at ath.forthnet.gr as 
other sending nad retrival mail accounts.

Is this what you mean?


> So the code becomes something like:
> MESSAGE = "From: \"{0}\" <nikos at hotmail.com>\r\n" "Reply-To: {0}\r\n" "To: {1}\r\n" "Subject: (From {0}) {2}\r\n\r\n{3}\r\n".format(FROM, TO, SUBJECT, MESSAGE)

If you mean the above then i just have tried, but still not mail gets send.


MESSAGE = "From: \"{0}\" <nikos at ath.forthnet.gr>\r\n" "Reply-To: 
{0}\r\n" "To: {1}\r\n" "Subject: (From {0}) {2}\r\n\r\n{3}\r\n".format( 
FROM, TO, SUBJECT, MESSAGE )
MESSAGE = MESSAGE.encode('utf-8')
		
# open Gmail's SMTP server
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()

# next, log in to the server
server.login("my_personal at gmail.com", "my_password")


Please elaborate further, thank you.

-- 
Webhost <http://superhost.gr>



More information about the Python-list mailing list