Sending mail from Erlang - OTP app or OS app - email

When I need to send occasional notification emails from an Erlang app (there's no need for the app to receive emails), I can pick one of two ways:
use a simple OTP app only for sending, like esmtp
use a simple (send-only) OS app like ssmtp and make a call to it from the Erlang app via os:cmd and compose the message (containing information from the running system) by writing to a file from within the Erlang app.
They both work, but I don't know if there are any dis/advantages to either approach. Which is better suited for a production system?

You may try to use AWS SES (Send Email Service)
there is aws erlang api to send mail via erlang driver
so you may send formatted or raw messages including html pages.
also you may add ses headers to see statistic about how many email have opened by customer and what clicks to they done
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/event-publishing-cloudwatch-tutorial-send-email.html

Related

Send emails from flutter application without expenses or smtp server and without opening the gmail app

As the title says, I would like to know if there is any way to send emails without having to use an external service, that charges me for sending the messages, or having to use an SMTP server in which each user has to be registered.
I have also seen pages like email.js but I don't want to have to pay for that if there is a possibility to do it on my own. It is also not useful for me to open the Gmail or messaging application of the device itself since I already know how to do that and it is not what I want.
For better understanding, I will give an example of what I want to do.
What I want is that from my application the user writes a message and from there that email message is sent to several different users from a list, without having to log in or anything, since the emails will be sent from my own email account. gmail that I have specifically created for the application.
I have seen the smtp server but from the information that I have seen that server implies that I have to log in to be able to have the token and that is not what I want because I want that once I configure everything there is no need to do anything else that people receive your messages and that's it.
I don't know if this is possible but I hope someone can help me.
Sending emails without your user logging in would require you to have either the credentials stored in the app (which is unsafe) or use a custom backend server that will host all the credentials that cannot be extracted. I would advise going with the backend route because it is easier to setup and your application will simply perform a HTTP request to get it done.
From the documentation of the mailer package, you can implement the server method pretty easily and get it moving. You will have to find a free web hosting service to deploy to.
There would really be otherwise no other way to get what you desire for virtually free.

Transactional Email and Meteor

I have an app written in PHP that I am porting to Meteor. This question is really two parts:
1) Currently, my server forwards all email to a PHP script that parses out the response and inserts it into a database, allowing users to respond to message threads by emailing reply+someidentifier#myapp.com. What is the best way of accomplishing this now that I am using Meteor?
2) From a performance perspective, should I running this on the same server that is hosting my application. Is this scalable?
I didn't notice it but you're using procmail? I've never done this before but you could tell procmail to put its files into a folder that Meteor can access. Then use the fs npm module to parse through these every few minutes & put these into a collection using the server side js.
From there you could make the UI you want to use to reply/make threads, etc.
Meteor uses Mailgun http://www.mailgun.com/ to send email. It's free to send up to 200 email per day.
I never tried it, but Mailgun can also receive email and then call a HTTP POST request to your app (meteor) that contains the information about the mail. With the router package, you should be able to handle this request on the server.

automatic background email from iphone application to users

I am so confused. My simple requirement is: i have an application which contains confirmation form i.e. nib file. It contains some textFields like name, age, email etc. I simply want when somebody click on submit button application send background and automatic email to email defined in textField. that email contain all information like name, age etc. User need not to fil anything and it should work in background. There are so many application do the same thing. I am creating booking application.
So how can i impliment this behaviour.
Apple does not provide a way to do this - and for good reason. Sending emails from the phone automatically introduces a lot of security risks.
I am willing to bet that the apps that do this use an intermediary server to which they post the data. When the data is posted then the server handles the sending of the emails.
To do this:
Send an HTTPS POST request to your server application.
From your server application, send an email via SMTP (or APIs built on top of SMTP).
Google AppEngine provides a simple and cheap way to create such a web service, running on top of Google's cloud-computing infrastructure. The sending mail from AppEngine help document includes detailed examples of how to send mail from your server application (assuming you use the Python version of Google AppEngine).
Unfortunately, there is no official feature for this but you could download a third-party library. Refer here for a couple of suggestions.

Sending mail regularly

I have an application that collects the report on usage and stores it into the core data model. The application has to send mail every hour to the client despite of the application running or not. I have created a java servlet that runs on google app engine to send email every hour. But, the mail is sent with all the information collected from the iphone.
So, how is it possible to collect data and send mail frequently ? Or how should be the server model(cron job or database) such that it gives smoother user experience.
I did something like this a while ago, you have to be cunning about it.
You can schedule methods for the iPhone to run, and its meant for VOIP, but you can just claim your app is a voip app and run this in the BG. How to Maintain VOIP socket connection in background?
In that method you can send an email out. You won't be able to do it with user input, obviously, but there is a google project out there for easy sending email. http://code.google.com/p/remail-iphone/

Can I send email programmatically in iPhone app?

I need to be able to send a pre-formatted email or SMS text message programmatically from within an iphone app. Can this be done? I have looked at apple's MFMailComposeViewController class, but this "provides a standard interface that manages the editing and sending an email message" and the MFMessageComposeViewController class also has it's own "standard system interface for composing SMS text messages". These allow you to present an interface to the user where they have to fill in all the data and then explicitly press a send button.
I cannot use this boilerplate functionality.
I need to be able to send a message without presenting any interface to the user. I know this sounds evil, but actually it is for a commercial application which needs to communicate to a user group in a central office when users in the field have performed specific actions out in the field.
Has anyone found a solution to this?
After much investigation, I have found that sending emails programmatically, without user intervention, from an iphone application, cannot be implemented using any of the apple frameworks.
Set up a web service you can post to using an HTTP request. If you are posting to only one address this can work very well, although you may want to get the user to input their return mail address.
Otherwise only the standard dialog is available (this relies on using whatever account they've setup on the device).
Here are a few SMTP API's that work on OS X. They might work on iOS as well.
Pantomime
MailCore
EdMessage
Only Possible via Web Interface, you can not hide the Interface , this is as per apple Guidlines to Developer and as per documentation
Looking for a solution to such a problem, I found something interesting here: How to send mail from iphone app without showing MFMailComposeViewController?
I hope this will be useful!
This is standard not possible. If you can't use the standard dialog you need to use SMTP.
SMS is the same, use the dialog of use a webbased sms service (most of these cost some money).
I have no experience with iOS, but I have enough experience with email protocols to say I'd be very surprised if a client application could send email without accessing a server. More than likely, the email will be sent using the SMTP protocol and therefore must be sent using an SMTP server. Choosing how you connect to that server is about the only option you have. You could connect to a server-side script (such as php) to generate and send the email, or you may be able to create a socket and connect directly to port 25 on the SMTP server and still generate the email from you client application.
Check out:
RFC 5321 at https://www.rfc-editor.org/rfc/rfc5321
SMTP on Wikipedia at http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
You could always do a low level telnet using SMTP protocol to a known mail server to send a message. I don't know if Apple will reject the app, but SMTP is damned simple.