It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I was hoping someone could help me. I am making a program in which you can enter some data and the program should mail the output of the program. My program gives the correct output. But I was wondering if there is a way to copy this output to an email?
Thanks in advance .
Comments
I dont know how to do it directly with Codea. But you could do it indirectly:
1/ write a php web page that can receive a file and sent by mail (i dont know how to do it but i've seen in the php doc it is possible).
2/ make codea send the file to your web page via hhtp.request method
Ok thanks I'll try that !
Use openurl("mailto://user@server")
Hello @KoBa. With the benefit of @tnlogy's advice, this page on the Codea Wiki may help.
Thanks for the comments. But in the example you still have to write the message in the code
itself. I am trying to mail a couple of strings is this even possible with codea? Because the mailto comment does not take a string or table as an input.
.@KoBa - alternatively use the runtime and do it in Objective C. iOS6 makes it really easy to send an email, SMS, or post to twitter/facebook using the provided Activity View Controller class. For example:
interesting - the pre lang = "objc" trick doesn't seem to work.
Check out my post here: http://twolivesleft.com/Codea/Talk/discussion/1123/the-power-of-openurl#Item_5
There is some code that demonstrates URL schemes. You'll find a scheme starting with "mailto://" which sends and email. Look here for a little more info: http://email.about.com/cs/standards/a/mailto_js.htm
Good luck!
Thanks for all the help! It works !
I was hoping someone could help me again. Sorry I'm totally new to Lua, so I don't exactly know what I'm doing :P. Anyway, I managed to insert a string in my program and show this string in an email. This works fine for one string. However, when I try to do this for multiple strings it doesn't work. I made a table of the strings and then used tostring on this table. The email shows table 0x... Is it even possible with tostring?
Thanks in advance!
Is this something like what you're after.
Very cool @dave1707 . Thanks for sharing.
One thing I noticed with this is that leading spaces on a message line are ignored. I don't know if there's a way around it, or if that's just the way it is. So you can't format lines, they are all left justified.
@dave1707 Thanks! That's exactly what I need =D
The meathod that @dave1707 used is called a regular expression. To learn more about it, go to http://en.wikipedia.org/wiki/Regular_expression
@Zoyt, Technically lua doesn't have regular expressions built in. It uses patterns. They aren't as powerful as regular expressions, but are usually good enough.
I'm using this code, to allow devices with iOS5 to send twits too:
you have to wait until Codea engine launch, there is an warning appearing if you call the function before that:
looks like there is no access directly to the main view that twetter needs...
I would like to know if the Codea runtime library has an call to the tweeter send button when you use the capture button (video and image)
I wonder whether there is a way to let the program send an e-mail, without opening the mail app on the iPad. I found that it could be done using smtp. http://w3.impa.br/~diego/software/luasocket/smtp.html . However, I've read that the use of sockets in Codea is not possible. I was hoping someone could help me
, sorry I'm still new to al this stuff :P
possibly, if u use http.request parameter tables to post the data to a server which sends the data as an email
@juaxix - That's a deprecated class, just to let you know. You reminded me - I need to share my Obj-C classes. I'll do that soon. Mine contains tweeting, FaceBook, and saving to the camera roll.
Thanks!
I would like to reanimate this thread to ask how I could attach a screenshot to Dave1707 's fantastic example. The first four lines should create the image, how can it be attached to the e-mail?
@Surfer This is a simple mail format, and as far as I know, you can't send an image. It's just text.
Thanks @dave1707 , do you know if the image "myScreenshot" can be saved to the photoalbum then?
@Surfer Here's an example of saving the image to the Dropbox folder. It can be synced with the Dropbox app and once it's there, a lot of things can be done with it. For instance, it can be emailed to someone which is what I think you were trying to do with the above code.
Hi Dave!
This will be good for internal use but I would like the user of my app to be able to send me a screenshot. I'm afraid having her or him use dropbox assets is around one corner too much.
Could it be possible to trigger the original function of the ipad to do screenshots? That's pressing the round button on front and small button on top together. The image goes directly to the photoalbum then.
Otherwise as a last option I will have to write the above instruction on screen and let the user do the screenshot manually.
Thanks so much!
@Surfer I don't know right now if there's a way for someone to email you a screen shot using Codea. For now the best way is to do a screen shot which goes to the photo library. From the photo library, the image can be emailed to you.