stmp and imap send and fetch - swift

I'd like to make a simple program to send and fetch emails from selected email. Is there any simple methods of doing that? I searched, and found a couple of examples like https://developer.ibm.com/swift/2017/05/31/4675/ , but is there any way to simplify that? (to simplify code to up couple of functions or use only basics of that? Instead of loading frameworks, or loading only needed elements?) It's for Mac OS X prog.
Main question is is it possible to simplify this process and how to fetch email (one or more) from server back to app or something similar.
Is there any MessageUI equivalent for mac os?

Related

Get EV3's serial number from program

I'm going to sell a lego mindstorms EV3 appliaction and I want to protect it. I'm not going to sell source code, only the compiled code so it's not possible to edit it. And to stop anyone from sharing it, I'd like to protect it somehow. The only way I found is to get EV3's s/n or any similar number that's uniquie in every EV3, it'd be easy. So, is this possible? Or are there any other ways to protect my program from sharing it? Thanks!
I am not aware of a serial number that can be read via code. You could use the MAC address of the bluetooth module.

Best way to handle events in ecommerce store

I have the ecommerce store.
I faced automatization problems as my business growing.
My website is written in PHP on Kohana Framework.
I want to automize many processes, but do not know where to dig deeper.
Example:
When order is recieved I want to fire the event "order.recieved". This event knows that my system needs to fire subevents and other actions:
to log inventrory changes asynchronously;
send to the procurement module out-of-stock products and their quantity;
to recreate sliced inventory table asynchronously;
send real-time message to crm system that order is recieved;
send sms to the client with message "We will call you soon";
etc.
Solutions I have in my head:
1) I think the simplest way is to rewrite my application on Laravel framework with it's event dispatcher.
Challenges:
I want use fifo (First In, First Out) for the inventory change;
I need digging to the code to know how many events I have in my system, when they are used,
2) Use AMQP Middleware like RabbitMQ.
Challenges:
I need digging to the code to know where exactly message is sent;
Maybe It can be solved with some event dispatcher, but ->;
Again, I need digging to the code to know how many events I have in my system, when they are used
Are php workers/consumers good to handle messages? Or I need to use python, nodejs?
Challenges:
I need to have many php workers/consumers. I think PHP is not good to handle this.
3) Use some webhooks management system.
4) Study more and use some bpm engine. Only one thing I know right now I can benefit using business rule engine for complex discounts.
What solution I need to take and get deeper with it?

Send link to update DB with Data

In our iPhone app , we offer email templates populated with DB. also user can create their own templates.
Say for example , i have my own templates created over 500 entries to use
here i need to know the possibility on the below things since my client asks me.
If i want to to send my templates stored into my DB to myfriend who uses the same application.( So my friend does not have to create the templets on his own , he can use mine)
Can that user be able to load those template details ( DB information ) into his app? (like posting the db contents to server and the same content can be loaded into his app using link)
I think it cant be done but i would like to know opinions and views to convey this to my superior.
Thanks a lot
This could help: How do I associate file types with an iPhone application?
Okay, well.. It's possible to do what you are trying to do.
You would need to
Serialize the data that's stored in the DB
Figure out a way to send this data to the server/as an attachment in an email over to your friend.
So from that point of view,
Doing the first is pretty simple. If its all just string content, you can serialize it into an XML/JSON. There are a lot of ways out there that converts objects into strings or bytes to send them over the network anywhere you please.
The second needs support from the server. You would need a server that can identify the applications from one another. ie. yours from that of your friend's. It should then be made to handle the serialized content you are planning to send over and then figure out a way to send it to the friend. maybe a push notification? You could possibly look at Urban Airship or some such offering for doing this incase you dont have an existing server.
Or, you can cut yourself all the work and see if your workflow can fit into this
http://www.raywenderlich.com/1980/how-to-import-and-export-app-data-via-email-in-your-ios-app

iphone : Is it legal to send an email from my app via an external server (with a PHP script)

i wonder what is the best solution to send an email from my app.
I have two solutions :
1- using MFMailComposeViewController :
it works well. Easy to use. but use an huge amount of RAM : in activity monitor, when i use this, the RAM allocation grows from ~10 Mo to ~20Mo, and is never freed
2- Setup a PHP-Script that handles sending email.
it works very well too. And it uses very few RAM : around ~3 Mo with this solution.
So, my question is :
does this is allowed by apple ?
Does anyone is using this solution in his app ?
I'm pretty sure apple doesn't care how some email gets sent out when people use your app.
The more important issue is that when sending from the device, using MFMailComposeViewController, you get the following for free:
users see a familiar interface
users send their mail from their own account
users have messages in their sent folder
users can choose to archive a message
Using your own php script, you get:
a lot of extra work to do, and stuff to maintain
either A) always the same sender address (from your script), or B) an address that the user must type in (afaik there is no legal way to get an email address from iOS)
in case B), trying to send on behalf of the user, you will run into spam filters quickly (think about SPF and such)
Looking at these things, the proposed solutions are really not comparable. So the real question is, what kind of email is sent out. Is it feedback sent to you, or is it mail sent on behalf of the user?
The memory concerns are new to me, I never experienced such problems. Do you handle memory management the proper way? If so, there is nothing to worry about. Don't focus too much on the "activity monitor" if you're not actually experiencing problems.
I'll throw in a third alternative here. If you want to leverage a web service for emailing you could leverage an existing email service such as PostageApp (http://postageapp.com/). They have a a library you can use as part of your iOS / Mac app that interfaces with the API which allows you to send email from Objective-C. You can check out the plugin here:
http://dev.postageapp.com/pages/plugins.html. The nice thing about leveraging a service like this is you don't have to worry about the internals of sending email and lets you focus on your application.
(Disclosure: I work for PostageApp and built the plugin)

Email to rss on server

for my group at the university I'd like to set up a server-sided email-to-rss service.
It should work like that, that different people can send emails to a certain address (nothing proprietary like gmail but a certain imap or pop server) which will the be translated into an rss feed. One main and important feature has to be that one can see the sender of the email in the feed. Furthermore it would be nice (to take the load off the server) if the emails get translated to a feed only once a day or so.
Does anyone has some input on this subject? Are there any scripts/services which will allow that?
Thanks a bunch.
Instead of "reinventing the wheel", you could use a mailing list that supports RSS. Your people can then write the mails to the mailing list and you can then use the mailing list's RSS feed however you intend to.
This should help you find a solution: https://encrypted.google.com/search?q=mailing%20list%20rss
Pick a programming language you're familiar with, then use either an imap library to fetch the E-mails (through cron, every hour or something like that), or if you have access to procmail on your mail server, launch your script as an email arrives (this shouldn't be too much work to handle for a server, unless you're talking a vast amount of E-mail).
The script would just insert the E-mails into a database, before extracting them and outputting the RSS-feed directly from that (this shouldn't be more than a handful of lines of code).
There's a couple of providers that does this for you, although it seems that the most popular ones have disappeared. Advanced Email2RSS seems to be an option, although I have no idea how good they are or if it'll even solve your issue.