[TriEmbed] Simplest way to send e-mail from Python? Carl?

Shane Trent shanedtrent at gmail.com
Mon May 18 17:13:15 CDT 2015


Carl,

Back in the day you could send e-mail without validating user credentials
on the outgoing mail server. I spoofed a sender's e-mail address
(demonstration as proof of concept) for a message going through the servers
at Oak Ridge National Lab in the mid 90's so no validation was a common
practice back then. Sending without validation is the only thing that I can
come up with to explain how or why the Ruby snippet works. But it does
work. It's part of a project to use SMS to trigger and log events using
Twilio and Gmail and IFTTT and Google Drive (kind of an Internet of Things:
Duct-Tape Edition!)

I would rather have a token or credential to validate for the outgoing mail
server if validation is unavoidable. The thought of having my password
setting in a directory in clear text gives me the heebee jeebees. I may use
SMS for communication if I cannot figure out how to send e-mail without the
clear text password.

Thanks for chiming in! I would much prefer to start with an expert opinion
rather than have to sort through a mountain of Google hits!

On Mon, May 18, 2015 at 5:35 PM, Carl Nobile <carl.nobile at gmail.com> wrote:

> Just thought of something else.
>
> If you are just trying to send an email from your local machine to any
> email address that can be done with no password, but you need mail services
> setup on your local machine which most people don't have setup. Then, once
> again, that could be written in any language.
>
> Carl
>
>
> On Mon, May 18, 2015 at 5:30 PM, Carl Nobile <carl.nobile at gmail.com>
> wrote:
>
>> Shane,
>>
>> The only way to not send a password in clear text is to use one of the
>> secure mail transports using either port 587 or 995, both are different and
>> independent of programming language. The client in Python is quite easy,
>> and I have written many in the past. The Ruby code snippet would need to
>> use one of the two ports above in order to be secure which can be done in
>> any language. Also the receiving end must support the one you choose or you
>> won't even get a connection.
>>
>> From the code I see above that would send everything in clear text. To
>> not send a password or even use one would mean there was no password on the
>> account, which I don't believe. So, I'm a little confused here as to what
>> is happening.
>>
>> Carl
>>
>>
>> On Mon, May 18, 2015 at 5:16 PM, Shane Trent via TriEmbed <
>> triembed at triembed.org> wrote:
>>
>>> I want to send e-mail from Python. The code below sends e-mail from Ruby
>>> and does not require having your e-mail password in clear text.
>>>
>>> require 'mail'
>>>
>>>     Mail.deliver do
>>>       from      'user at gmail.com'
>>>       to          'trigger at recipe.ifttt.com'
>>>       subject  '#1235'
>>>       body     "Request from: #{name}."
>>>     end
>>>
>>> Is there a similar way to send e-mail from Python without requiring your
>>> e-mail password in clear text in the code?
>>>
>>> Thanks,
>>> Shane
>>>
>>> --
>>> A blog about some of my projects.  http://fettricks.blogspot.com/
>>>
>>> _______________________________________________
>>> Triangle, NC Embedded Computing mailing list
>>> TriEmbed at triembed.org
>>> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>>> TriEmbed web site: http://TriEmbed.org
>>>
>>>
>>
>>
>> --
>>
>> -------------------------------------------------------------------------------
>> Carl J. Nobile (Software Engineer)
>> carl.nobile at gmail.com
>>
>> -------------------------------------------------------------------------------
>>
>
>
>
> --
>
> -------------------------------------------------------------------------------
> Carl J. Nobile (Software Engineer)
> carl.nobile at gmail.com
>
> -------------------------------------------------------------------------------
>



-- 
A blog about some of my projects.  http://fettricks.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20150518/d79a465d/attachment.htm>


More information about the TriEmbed mailing list