Send email: Difference between revisions

Content added Content deleted
Line 1,126: Line 1,126:
Howdy from a python function
Howdy from a python function
</pre>
</pre>

=== Windows ===
Using Outlook COM server with the Pywin32 library.

<lang python>import win32com.client

def sendmail(to, title, body):
olMailItem = 0
ol = win32com.client.Dispatch("Outlook.Application")
msg = ol.CreateItem(olMailItem)
msg.To = to
msg.Subject = title
msg.Body = body
msg.Send()
ol.Quit()

sendmail("somebody@somewhere", "Title", "Hello")</lang>


=={{header|R}}==
=={{header|R}}==