[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Sending attachments in email using mailer.py script

From: Nick Stolwijk <nick.stolwijk_at_gmail.com>
Date: Thu, 7 Oct 2010 01:45:12 +0200

You can checkout the file to /tmp and include it from there. You
cannot reference a file in your repository with a file path.

Hth,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl

On Thu, Oct 7, 2010 at 12:58 AM, Tech Geek <techgeek12345_at_gmail.com> wrote:
> I guess my biggest hurdle at this time is how to extract the file from the
> repository that I would like to send it as an attachment.
>
> Most of the examples on the net simply specifies an explicit filename (to
> show as an example) like this:
> *********************************************************************************
> #!/usr/bin/python
> import smtplib
> ......
> filename = "/tmp/test.txt"
> .....
> # Define the attachment section
> part3 = """Content-Type: multipart/mixed; name=\"%s\"
> Content-Transfer-Encoding:base64
> Content-Disposition: attachment; filename=%s
> .......
> %s
> --%s--
> """ %(filename, filename, encodedcontent, marker)
> message = part1 + part2 + part3
> try:
>    smtpObj = smtplib.SMTP('localhost')
>    smtpObj.sendmail(sender, reciever, message)
>    print "Successfully sent email"
> except Exception:
>    print "Error: unable to send email"
> *********************************************************************************
> So basically I would want the path
> /var/lib/svn/projectA/tags/REL-1.0/source.zip in the filename variable.
>
>
Received on 2010-10-07 01:45:53 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.