Alexandro ,
Thanks for the code, i certenly have to dive in PyThon, for the moment I
know mi way into Basic.
I built Basic apllications wher i need to send some messages to infoirm
other users that somethins is appen with some Document or Content. I
trye to combine Basic and you Python code, ji hope that i can know in
Basic it the message is sucfuly send by python or not...
Fernand
There are ways to send email from python, not sure if is a complete
solution for you but maybe it willl help if its like something of
personal use:
#!/usr/bin/python
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
import os
import sys
import urllib
gmail_user = "[email protected]"
gmail_pwd = "******"
def mail(to, subject, text):
msg = MIMEMultipart()
msg['From'] = "[email protected]"
msg['To'] = to
msg['Subject'] = subject
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(gmail_user, gmail_pwd)
mailServer.sendmail("[email protected]", to, msg.as_string())
# Should be mailServer.quit(), but that crashes...
mailServer.close()
if len(sys.argv) == 3:
url = 'http://tinyurl.com/api-create.php?url=' + sys.argv[2]
abre = urllib.urlopen(url)
tiny = ". " + abre.read()
mail("[email protected]",
sys.argv[1] + tiny, "<insert message>")
elif len(sys.argv) == 2:
mail("[email protected]",
sys.argv[1], "<insert message>")
else:
print "Te falto comandos"
This is a modified code to send email to a specific email account and
shorten links through tinyurl. If you dont need this you can ignore
the second part of the script. Also if you want to
On Wed, Apr 21, 2010 at 1:58 AM, Mathias Bauer <[email protected]> wrote:
Hi,
Fernand Vanrie wrote:
Paolo , Andrew, all
Can i have hope to set also the "body" of a email message ?
This is not possible by intent, as (at least to my knowledge) the
"mailto:" protocol we are using for the implementation of this service
on most platforms (at the end, it's a "simple" mail service) does not
allow to pass a body text to the mail client.
It could work with the MAPI based implementation on Windows, but if you
write platform specific code, you don't need a platform independent API
for that.
Regards,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]