Many thanks..It works

Le 12-déc.-11 à 18:53, Timofey Koolin a écrit :

from google.appengine.api import mail

message = mail.EmailMessage()


2011/12/12 Batistuta Gabriel <batistutagabrielf...@gmail.com>
Thanks.

What's the type of "message" in your answer.

Actually, I use this code :
Message msg = new MimeMessage(session);
msg.setDataHandler(new DataHandler(new ByteArrayDataSource(csv.getBytes(),"text/csv")));
msg.setFileName("data.csv");
                        
                        
msg.setFrom(new InternetAddress("***", "****"));
msg.addRecipient(Message.RecipientType.TO, new InternetAddress("****", "info"));
msg.setSubject("Export");

Transport.send(msg);


Thanks

Le 12-déc.-11 à 18:20, Timofey Koolin a écrit :

message = mail.EmailMessage()

message.sender = sender

message.subject =subjectmessage.to = receiver

message.body = text

message.attachments = [
                ("filename.csv", csv.getBytes())
]


2011/12/12 Timofey Koolin <timo...@koolin.ru>:
> message = mail.EmailMessage()message.sender = sendermessage.subject = > subjectmessage.to = receivermessage.body = textmessage.attachments = [
>                 ("filename.csv", csv.getBytes())            ]
> 2011/12/12 Bat <batistutagabrielf...@gmail.com>:
>> Hi,
>>
>> One of my servlet creates CSV content in a String variable.
>>
>> I'd like to send this CSV like an attachment file but everybody knows
>> the limitations of GAE : it's impossible to create a file. So, I
>> decided to find an another solution.
>>
>> Mine is to attach the CSV string like that :
>> String csv = "";
>> Message msg = new MimeMessage(session);
>> msg.setDataHandler(new DataHandler(new
>> ByteArrayDataSource(csv.getBytes(),"text/csv")));
>> msg.setFileName("data.csv");
>>
>> I receive the mail but without attachment. The CSV string is
>> integrated into the body part of the mail.
>>
>> How to attach this CSV string like a CSV file into the mail?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Google App Engine" group. >> To post to this group, send email to google-appengine@googlegroups.com . >> To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com . >> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en .
>>
>
>
>
> --
> Blog: www.rekby.ru



--
Blog: www.rekby.ru


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com . To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en .


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google- appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en .



--
Blog: www.rekby.ru

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google- appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en .

--
You received this message because you are subscribed to the Google Groups "Google 
App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to