Saturday, April 28, 2012

Sending and receiving emails in WLST / Python

http://docs.python.org/library/smtplib.html

import smtplib
s = smtplib.SMTP('smtp.acme.com')
#SMTP.sendmail(from_addr, to_addrs, msg[, mail_options, rcpt_options])
s.sendmail('pippo@gmail.com', 'pluto@gmail.com', 'ciao come stai?')
s.quit()

s.login('pierluigi.vernetto@acme.com', 'mypw')

Traceback (innermost last):
File "", line 1, in ?
File "/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst/modules/jython-modules.jar/Lib/smtplib.py", line 540, in login
SMTPException: SMTP AUTH extension not supported by server.

s.connect()



see
http://www.oracle.com/technetwork/java/javamail/index.html

No comments: