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8po2uB6ZX1J0iQpZ ... it's longer but you get the picture. Katie -----Original Message----- From: Berthold Stöger [mailto:bs@bdf-net.com] Sent: Thursday, June 29, 2006 1:07 AM To: zope@zope.org Cc: Kate Legere Subject: Re: [Zope] attaching an image to an email Hi, On Wednesday 28 June 2006 22:05, Kate Legere wrote:
<dtml-sendmail smtphost="mail.host.ca"> To: art critic From: patron Subject: Art
Hi, please take a look at my art and post it if you think it's good enough.
<dtml-mime type=image/jpeg encode=base64 name=resume><dtml-var pic.jpg > </dtml-mime>
</dtml-sendmail>
Try: <dtml-sendmail smtphost="host"> To: to From: from Subject: Art <dtml-mime type=text/plain encode=7bit> Hi, please take a look at my art and post it if you think it's good enough. <dtml-boundary type=image/jpeg encode=base64 name=resume><dtml-var "REQUEST['pic.jpg'].read()" ></dtml-mime> </dtml-sendmail> Of course this doesn't work if the user uploads a non-jpeg picture therefore some more elaborated code will be needed. HTH
Kate Legere schrieb:
I get a result like :
Cv/Y/+AAEEpGSUYAAQEBAEgASAAA/9sAQwAHBAQEBQQHBQUHCgcFBwoMCQcHCQwNCwsMCwsNEQ0N DQ0NDRENDxAREA8NFBQWFhQUHh0dHR4iIiIiIiIiIiIi/9sAQwEIBwcNDA0YEBAYGhURFRogICAg ICAgICAgICAgISAgICAgICEhISAgICEhISEhISEhIiIiIiIiIiIiIiIiIiIi/8AAEQgGggXsAwER AAIRAQMRAf/EABwAAAMBAQEBAQEAAAAAAAAAAAABAgMEBQYHCP/EAD8QAAICAgEDAwMDAwMDBAEA CwABAhEDITEEEkEFUWETInEGMoEUQpEVobEHI1IzYsHRFuHxJDRyFyVDgvCS/8QAGwEBAQEBAQEB AQAAAAAAAAAAAQIAAwQFBgf/xAAmEQEBAQEAAwEBAQEAAgMBAQEAARECEiExA0EEE1FhFCIyQgVx /9oADAMBAAIRAxEAPwDcrUANTIToYo6fIxg2gaQnoRTS+2w1NNcDqp8F+QtEinXv/Bt00d3KDGh9 y7fk2e04Nsel4EESHvYkl3XZg1jmlEkto541tCS7YSdozMc0EjajqM1Ois1pVLKQ6ah5P8lSJp4m Zl2ONafdRsCO9sLG1dU9GI+4cbQrMxXT4MTUv8mwYrXkNaG6H+mnYW+xaYX22l5HGJOXDGBbQ4yd 0Ta2ntCQ/kGCUTWsONBp6p1E2Jg4M0+jRRPlEYDVUUqlHgYLRFhcjG3oolbS0DWm+QiaezMSsMOG noWGgow0xjYTZoo6sqAqJY3wMmjB4sabDRIgQnAFbQjUGkbGIY2m6s2qGgtTgAhsrG1VLySaRX8T h34omGk03+CgS5GqPkIxpsbQf/JNY+NmlYas0OEmr2UIewgI1UafkGlCEAW0GY7XsZh4J1tFeSrT gdoxweTYB/cDaO73MKfd7CcLkax+CAEJH1ci/BsGj+qjwwxpSeaNa5EpUm2ONYuKfINFXQtTsAX4 GNqqsKxPRoQYWn8oohvRFgBQPYqFEsH8mBxoxLjYwDnbMSMDS9zaSto0B2mT8po2uB6ZX1J0iQpZ
... it's longer but you get the picture.
yes I get it, its an JPEG 1516x1666. Perfectly except for the extraneus \n (linefeed) in front of it. Thats the problem with DTML :-) You can work around it when you dont have newlines between the tags... Regards Tino
On Thursday 29 June 2006 15:34, Kate Legere wrote:
I get a result like :
Cv/Y/+AAEEpGSUYAAQEBAEgASAAA/9sAQwAHBAQEBQQHBQUHCgcFBwoMCQcHCQwNCwsMCwsNEQ0 [...] ... it's longer but you get the picture.
Yes, that's what a picture looks like in BASE64. Where is the problem? Can you maybe forward me (off-list) the whole E-Mail "sourcecode"? cu...
--On 30. Juni 2006 07:44:30 +0200 Berthold Stöger <blists@bdf-net.com> wrote:
On Thursday 29 June 2006 15:34, Kate Legere wrote:
I get a result like :
Cv/Y/+AAEEpGSUYAAQEBAEgASAAA/9sAQwAHBAQEBQQHBQUHCgcFBwoMCQcHCQwNCwsMCwsN EQ0 [...] ... it's longer but you get the picture.
Yes, that's what a picture looks like in BASE64. Where is the problem? Can you maybe forward me (off-list) the whole E-Mail "sourcecode"?
One should really take the *pain-free* way and use Python 'email' Modul to generate emails - at least when you want to deal with attachments in a reasonable way. -aj
On Friday 30 June 2006 07:47, Andreas Jung wrote:
One should really take the *pain-free* way and use Python 'email' Modul to generate emails - at least when you want to deal with attachments in a reasonable way.
*shrug* I've always found DTML to be more natural to generate emails than PythonScripts. I really don't see what the problem is with not adding whitespace where there should be no whitespace. Now if only I could send links to attached pictures with <dtml-sendmail>... cu...
participants (4)
-
Andreas Jung -
Berthold Stöger -
Kate Legere -
Tino Wildenhain