Marcus Alanen <[EMAIL PROTECTED]> writes:
> >>I've also tried opening a pipe to sendmail, and feeding the
> >>message to that instead. This too works great [but] doesn't
> >>seem like much of an improvement, portability-wise.
>
> No, but at least it can be expected to do the right thing
> w.r.t. s
Marcus Alanen <[EMAIL PROTECTED]> writes:
> Mike Meyer wrote:
>>>Finally, if at all possible I'd also like to get this working on
>>>Windows, so I'd rather stick with the standard smtplib if I can.
>> smtplib needs an SMTP server to connect to. For unix systems, this is
>> typically localhost. What
Mike Meyer wrote:
> BTW, an alternative for the username is the USER environment
> variable. I don't know whether or not it exists on Windows.
Or LOGNAME. Don't about windows, though.
>>I've also tried opening a pipe to sendmail, and feeding the
>>message to that instead. This too works great (an
There may have been a reason for the win32 stuff at some pointbut I
don't remember and you're right, it does seem like getpass by itself
would do the job.
Grig
--
http://mail.python.org/mailman/listinfo/python-list
Grig Gheorghiu wrote:
> I use this function as a platform-independent way of finding out the
> current user name:
>
> def get_username():
> if sys.platform == 'win32':
> return win32api.GetUserName()
> else:
> return getpass.getuser()
>
[e:\]python
Python 2.4.1 (#65, Mar
I use this function as a platform-independent way of finding out the
current user name:
def get_username():
if sys.platform == 'win32':
return win32api.GetUserName()
else:
return getpass.getuser()
--
http://mail.python.org/mailman/listinfo/python-list
Mike Meyer wrote:
> Leo Breebaart <[EMAIL PROTECTED]> writes:
>
> > I can get the username info (at least on Unix) via the 'pwd'
> > module, but that still leaves me with the domainname, or rather
> > the mailname, and I have not been able to spot a way of finding
> > that from within Python. (I
Leo Breebaart <[EMAIL PROTECTED]> writes:
> I can get the username info (at least on Unix) via the 'pwd'
> module, but that still leaves me with the domainname, or rather
> the mailname, and I have not been able to spot a way of finding
> that from within Python. (I could try opening /etc/mailname