Re: [Zope] how to send a mail attachment with python (ZPT) ?

2005-09-30 Thread Dieter Maurer
Georgakopoulos Nicolas wrote at 2005-9-30 17:25 +0300:
>I want to send values from a form by mail but I want to make this values 
>a file and then send that file as an attachment.

Use Python's "email" package to compose the email.

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] how to send a mail attachment with python (ZPT) ?

2005-09-30 Thread Georgakopoulos Nicolas
I want to send values from a form by mail but I want to make this values 
a file and then send that file as an attachment.

1.How can I make the values of the form to a file (maybe text file) ?
2.If I make that file how can I send it by mail as an attachment ?

My code for simple mail message  is (mailAction.py) :

# locate the mailhost
mailhost=container['mailhost']

# email message settings
recipient='[EMAIL PROTECTED]'
sender='[EMAIL PROTECTED]
subject='This is a test mail'

# format the email message
message='this is my message body...'

# send the message
mailhost.simple_send(recipient, sender, subject, message)

# return a confirmation message
page=container['thanks.html']
return page()

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )