How to send an email through AppleScript without the Mail app - email

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.

Related

Outlook Rule to Send Mail On Mail Receipt

Is there a way for Outlook 2010 to send an email whenever a message is received? I don’t want the original email forwarded or redirected (major business rules violation); I just want to receive an email alert at another address. It would be great if that message included the subject and sender but not necessary. It seems like there should be a rule to do this but I need help creating it.
I thought about using an Outlook rule to call a VBA script to send the email. I tested a couple of scripts but they didn’t work for me. I don’t think my account has the proper security clearance or the VM environment is configured to not allow sendmail scripts.
How to send a mail automatically
The accepted answer gives me the following error:
Line 6: Adodb.fields
Arguments are of the wrong type, out of acceptable range, or are in conflict with oneanother
Send Email using VBscript
The script given at the end of the thread gives me this error:
SendMail Failed: The transport failed to connect to the server
and the telnet test step failed as well.
And since I don't want to risk my job trying to circumvent security policy I really hope there is something built into Outlook that will allow me to accomplish my goal.
You can use Auto-Mate Pro, a 3rd party rule add-in for Outlook to do this. One of the rule actions is called "Send Message". There you can choose an predefined template you create for the email alert body. You can also specify the email address to send the alert email to.
www.pergenex.com/auto-mate
Hope it helps.

How to prevent the acidentally mail sending in my app?

Too many times i receive mails with no content or with just "Sent from my iPhone". Those mails are sent from the "contact" section in my app.
After a little bit, it became boring.
So, is there any way to prevent the accidentally mail sending? I'm tired to see blank emails!
Don't think one can do much about the empty mails. (Maybe I haven't received so many yet that it troubles me ;) )
On the there hand the benefit of receiving user mail with a contents outweighs the boring empty mails. So I would just put up with the empty mails and maybe create a filter in the email client.
You could use the addresses for a newsletter with info about your app (with an out-out of course)
As you can not send mail through phones mailApp without user pressing the send button you also can't stop it from sending mail. If it really really bothers you you'll have to encode your own SMTP protocol and start sending mail directly from your code. But is it really worth it?
Or you can make user to type the text into a form (textbox) before calling mail-app. If he wrote something you pass it to mail-app and then he must go trough 'send procedure'

AppleScript - How to send a email without the mail app opening up

I need to know how to send a email with applescript without having a email to send from. So basically using the mail app is out because I have to have the use input their email in order to send.
Could I do a shell script in side the applescript in order to send?
Try my python email shell script here. I have an example applescript at the bottom of the page showing how you can control the shell script from applescript.

Using AppleScript to send mail attachment through default email client

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.

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