Why from en to two times with sending email

Cecil Westerhof Cecil at decebal.nl
Mon May 4 16:13:24 EDT 2015


Op Monday 4 May 2015 21:48 CEST schreef Ian Kelly:

> On Mon, May 4, 2015 at 12:59 PM, Cecil Westerhof <Cecil at decebal.nl> wrote:
>> I want to change an old Bash script to Python. When I look at:
>> https://docs.python.org/2/library/email-examples.html
>>
>> Then from and to have to be used two times? Why is that?
>
> Once to construct the message headers, and once to instruct the SMTP
> server where to send the message. These are not required to agree;
> for instance, bcc recipients need to be supplied to the server but
> aren't included in the headers.

OK, thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list