Email Directly from python

Martin P. Hellwig xng at xs4all.nl
Wed Feb 13 16:15:22 EST 2008


brad wrote:
> Martin P. Hellwig wrote:
> 
>> The tricky part is how to resolve the mail server for a mail address. 
>> Usually you have to query the mx record of that domain. I solved that 
>> by  looking if I can find the nslookup binary.
> 
> The from and to are static constants... they don't change. Mail just 
> seems so tricky these days what with all the blacklists, greylists, 
> whitelists, etc. It's almost as if email is broken.  Location of the 
> sending pc matters too. Just wondering if there is a super simple one 
> liner in Python (that's portable) that can do this.
> 
Well the problem is that you can't control whether the to address won't 
be handled with a different mail server in the future. Whether the 
receiving party marks your mail as spam or not is actually their 
problem. If you act according to the RFC's it should be delivered.
Of course it helps if you don't make the content be spam ;-)

-- 
mph



More information about the Python-list mailing list