Using AppleScript to send mail attachment through default email client - email

Is it possible in any way to send an email attachment through the user's default email client using AppleScript? I'm assuming there is no easy way of doing this, as the programs themselves have to implement AppleScript and every email client will implement it differently and require a different script for sending an email with an attachment.
I've searched around and only found this:
http://macscripter.net/viewtopic.php?id=12463
Which can, via Applescript, give me the name of the default email client. Has anyone looked into this before?
Thank you.

You are correct. You'll have to implement different applescript code for each email client. As such you'll probably want to limit the email clients your application will support and make that clear to your users.
The only other way for it to work universally is for you to implement your own email system. I have a python script that I can call from an applescript using "do shell script" to send emails. Of course you'll need to know the user's information (smtp server, username, etc). If you're interested you can see my python script here. It doesn't handle attachments but some google searching should show you how to modify it.

Related

How to send an email through AppleScript without the Mail app

I need to create an AppleScript program that will send an email no matter what. That means that the Apple Mail app is out of question, because some people do not have Mail set up. I thought that one way would be to send the email through Terminal, but I have no idea how. I need some way to send an email through AppleScript without the Mail app.
Here you can find a python script to send email and there's applescript code on the page to show how you can call the python script from applescript. Note that you have to supply smtp information to the script, which is essentially the information that you use to setup Mail.app.
So if you wanted a "no matter what" type of solution you would have to include your own smtp info in your code.

Best way to send a bunch of emails without user input on iOS?

First, let me get this out of the way and say this isn't a spam application. I'm writing an app that allows users to share files with multiple friends easily via email.
Right now, I'm using SKPSMTPMessage to send out emails to a list of recipients at the user's request. It works, but I wonder if there isn't a better solution here. For example, if it might be better to send the smtp info and attachments to my server, and conduct the sending from there in order to avoid repetitive attachment uploads on the device.
I am also considering how to handle cases where there is no connection available (determining connection error vs other kinds of errors and persisting the failed message for a later retry).
Any advice on the best way to structure this service would be greatly appreciated.
In order to customize the user experience for sending e-mail you need access to their email details, IMAP, POP, etc. if you want that user to be the one sending the e-mail.
The solution I use is to have the from address be an e-mail I control and use a 3rd party email provider, ex: SendGrid, PostMark, Mandrill and plug in to their api's to send e-mails.

Example for Email User Interface Implementation Like Followup.cc

I want to create a new software that can be controlled by email.
It will work like followup.cc or followupthen.com.
The users of these softwares can give commands to the system by using only email. For example, sending an email to 1minute#followup.cc sets the system to send a notification email after 1 minute. Or sending an email to 4weeks#followup.cc sets the system to send a notification email after 4 weeks.
I have never seen an example for implementing such an email user interface. I don't know where to start. Do you know of any good tutorial or open source code that I can take as example?
Note: I appreciate anything useful but my preferred programming languages are python or java.
Use the SubEthaSMTP library to receive mail. That gives you the SMTP envelope information: reverse-path (usually the sender's email address), recipient and message content as a stream.
Based on your question it seems that you do not need to parse the message (for example to retrieve the subject), but if do need, then parse the mail using the JavaMail library.
You can find example code in the SubEthaSMTP wiki pages. A more complex example is SubEtha Mail, a mail list manager.

How to implement a "reply to this email" feature for my web application?

I have an application that sends emails when a user creates/modifies a record. I would like my users to be able to reply to the email that was sent to them and have the web application receive the email, parse it and update the record automatically. I have seen this done in web apps like Basecamp. The email usually says "Reply above this line", and if you simply reply to the email, you don't have to log in to the web application in order to update your ticket/conversation.
How can I go about implementing this sort of functionaly? (I'm not looking for a particular language implementation, but rather a language agnostic solution).
There are 2 ways you can do this:
You could use a Procmail filter to pipe the incoming email to your script. This would need some 'nix knowhow to setup - but it's certainly possible to do what you described via this method.
Use a service like MailGun - they do all the hard work of setting up and configuring the mail server stuff and expose it to you via a nice programmable web API. I've been evaluating it this week to solve a similar problem like the one you are having and I can tell you: it is really cool and I highly recommend you check it out yourself.
You'll need to implement a service/daemon that polls an email inbox for new messages. To relate an incoming email to the corresponding data, you can include an id in the outgoing email's subject.
I agree you should created a system to receive the incoming email but I don't necessarily agree that polling for it is the correct solution. Take a look at a blog post I wrote on the subject here. It relates to Rails but the concepts should work in any language. That's why we wrote the CloudMailin system to provide a better way of receiving the email.
Also you can use a unique from address for each email that would prevent the user from altering the subject line being a problem. The disposable part of an email address is useful for that. reply+user123#example.com for example.

Detecting outlook 2007 client in email

Is it possible to detect the email client in an html message? Specifically outlook 2007
Update
My users have access to an online system that really has nothing to do with email, but in this system they can all communicate with themselves.
My app - takes messages from this system, and then sends it via an email instead.
Now I need a reply to function. Obviously its not a normal email address so...
I want a way to intercept this message, and send it via another channel.
I could write the outlook plug to check EVERY SINGLE out going email address, but this surely can't be the way we're expected to work with email.
It would be much easier to have a button in the email itself which can call an outlook function (custom) and then pass control to this function.
Uodate
Thanks guys for your answer, but there is a little more complexity. The online system contains fields, these fields need to be completed by the user before sending the reply. So I need some kind of form (yes with working check boxes, etc in there). This should all be in the email message.
Essentially what you'll need to do is set up an automated process that monitors a particular email address, and set that address as the reply-to in your outgoing email. When a message comes in, you can do whatever analysis you need to (examining the from, subject, etc.) and process the content however you see fit.
"Detect" using what? Javascript does not work in email. CSS stylesheets don't either - so no CSS hacks.
Have you tried to change the Reply-To header in the email to the direction that you want?
You have an example in C# & VB in: http://www.systemwebmail.com/faq/2.7.aspx