1. tomexx's Avatar
    Hi,
    I'd like to send an email from my playbook.
    I created the app in FlashBuilder 4.6 (Flex mobile project).

    Ideally I'd like to send the contents of a dataGrid control in the email.

    Is this possible?

    Thanks,
    Tomexx
    03-13-12 08:52 AM
  2. EhrlichParr's Avatar
    Well we don't know what you have developed so none of use would be able to provide any definite solution. I would advise you to go to adope dot com's FAQ page and see if you get any answer to your query.
    03-13-12 10:13 AM
  3. BuzzStarField's Avatar
    Hi,
    I'd like to send an email from my playbook.
    I created the app in FlashBuilder 4.6 (Flex mobile project).

    Ideally I'd like to send the contents of a dataGrid control in the email.

    Is this possible?

    Thanks,
    Tomexx
    There is no easy way to accomplish this feat. RIM does not provide any communication APIs yet so you need to roll your own solution. Basically, you need to implement a custom POP3 mail client that talks to the user's email provider. I suggest you look a the Files and Folders app to see what an interface might look like. This app can send files via email but is described as "experimental" because it may not work for everyone.
    03-13-12 10:23 AM
  4. peter9477's Avatar
    Buzz, that would be SMTP, not POP3... And anyway it's not really feasible to do this with AIR on the PlayBook as you can't implement proper MX record lookups to a DNS server to find where to send the emails.

    The best option by far for now is to set up a web service and have your app send the message to it using HTTPS, then have the server forward the message to the recipient(s).
    BuzzStarField likes this.
    03-13-12 10:31 AM
  5. tomexx's Avatar
    Thank you guys.
    Well looks like it's not going to be an easy solution.

    Instead of email, I could also use Copy/Paste.

    Would copying the contents of a dataGrid to clipboard be any easier?
    OR copying multi-dimentional array that feeds the dataGrid to clipboard.

    This way the user would just paste it to their own email/word processor program.

    Thanks,
    Tomexx
    03-13-12 11:15 AM
  6. BuzzStarField's Avatar
    Thank you guys.
    Well looks like it's not going to be an easy solution.

    Instead of email, I could also use Copy/Paste.

    Would copying the contents of a dataGrid to clipboard be any easier?
    OR copying multi-dimentional array that feeds the dataGrid to clipboard.

    This way the user would just paste it to their own email/word processor program.

    Thanks,
    Tomexx
    Why not just allow the user to save the data in the shared folder as a csv file? The user could dispose of the data as they wished including emailing the file or importing it into excel.

    @Peter
    I stand corrected. I should know better since I wrote my own SMPT client using Java/JSP some years ago. I use the webservice in exactly the way you suggested so that my clients receive an email when a user fills out the form on the "contact us" page.
    peter9477 likes this.
    03-13-12 03:46 PM
  7. peter9477's Avatar
    Why not just allow the user to save the data in the shared folder as a csv file? The user could dispose of the data as they wished including emailing the file or importing it into excel.
    That's an excellent idea. ;-)

    Two things I'll point out from my own experience and user comments about Battery Guru (which has a CSV export feature):

    1. The .csv file extension is unfortunately not "seen" (along with most others) by the native file manager/dialog in the PlayBook, so users who don't know how to rename files with a third-party tool like Files & Folders or AIR Browser may have trouble attaching it.

    2. The PlayBooks Sheets To Go program inexplicably can't handle CSV files, making it useless without an .xls converter.

    3. Some users don't know how to use the file sharing feature, so they don't know how to get .csv files (or many others) out of their system. If it's not "media" included in the backup, or something they can email, they may be out of luck.

    None of these are unfixable problems... just things to note. I'll probably include automatic .zip packaging for Battery Guru's export file in future, since most of the files are too large to be used effectively in Sheets To Go even once converted, and the .zip extension is seen by the file manager so it's fine for attaching to emails.
    03-13-12 04:22 PM
  8. tomexx's Avatar
    Why not just allow the user to save the data in the shared folder as a csv file? The user could dispose of the data as they wished including emailing the file or importing it into excel.



    BuzzStarField,

    Can you give me an example of writing .csv files? A text file would accomplished the same purpose I suppose?

    Also, I'm not sure where shared folders are...

    (I'm new to the AIR/Flex enviroment)

    Thanks,
    Tom
    03-13-12 04:41 PM
  9. BuzzStarField's Avatar
    I could set up a public webservice for relaying HTTP post data to email recipients without too much difficulty. I would need to implement security features to prevent abuse (spam) and would need to throttle throughput at a reasonable level to avoid overloading my server. I worry though that this could cause me more grief than it's worth. Any suggestions?
    03-13-12 05:00 PM
  10. BuzzStarField's Avatar
    BuzzStarField,

    Can you give me an example of writing .csv files? A text file would accomplished the same purpose I suppose?

    Also, I'm not sure where shared folders are...

    (I'm new to the AIR/Flex enviroment)

    Thanks,
    Tom
    A csv (comma-separated values) file is just a text file in a particular format. A web search will yield all the information that you require.

    For information about how to use the PB file system consult the RIM documentation for your chosen SDK. Again, Google is your friend. I found the following documentation for the WebWorks framework at this URL:

    https://bdsc.webapps.blackberry.com/...ry.io.dir.html
    03-13-12 05:11 PM
  11. kdna's Avatar
    There's a really easy way to do this if you're using WebWorks (the html5/js) SDK.
    Message me if you have any interest in figuring out how.
    03-15-12 01:05 AM
  12. SCrid2000's Avatar
    There's a really easy way to do this if you're using WebWorks (the html5/js) SDK.
    Message me if you have any interest in figuring out how.
    If you mean <a href="mailto:emailaddressk">Contact Me!</a>, then you'll be disappointed to know it doesn't work in OS2.
    03-22-12 11:47 PM
  13. kdna's Avatar
    If you mean <a href="mailto:emailaddressk">Contact Me!</a>, then you'll be disappointed to know it doesn't work in OS2.
    Yeah figured that out. Really weird that if you type the same mailto: link inside of the Browser it DOES launch messages.

    Completely disappointed. Seems like NATIVE SDK does have the functionality however.
    03-22-12 11:57 PM
LINK TO POST COPIED TO CLIPBOARD