I am using Indy in Delphi to create and send emails to an exchange mail server.
For messages with only one part, the exchange server correctly adds a disclaimer. However if I create emails with mutlipart/alternative, with both plain text and a html message parts, exchange does not add the disclaimer.
I'm thinking I must have structured my email wrong?
Can you check the FallbackAction in Exchange transport rules ?
If it can't add the disclaimer for some reason, it will either:
Send it without one (ignore)
Send a new message with the original attached (wrap)
Reject it (reject)
Maybe setting to wrap will solve the problem...
Related
My intranet web application (written in C#/ASP.Net MVC) sends email notifications in certain situations. I would like to intercept replies to such emails and perform actions based on the content of such replies.
I have no preference for scripting language - it could be Powershell, Python, VBA, anything - as long as I can parse the subject and body of the email, I can then alter the database of my web application through this script and pick up changes with an automated task, but I really have no clue where to start. I would be really grateful if someone could point me in the right direction.
QUESTION
How can I intercept emails sent to the Outlook server and perform action based on the content of such emails?
It sounds like you need an inbound email parsing service. I've worked with the one from SendGrid and it will catch any replies to a specific email address, and then post the email contents to an action on a controller in your MVC app. This will give you access to the full email contents and you can process it as needed.
See Setting up Inbound Parse
With my rails application, I'm supposed to provide following features:
There a limited number of users interacting with my system (in order of 10 to 20)
Like any normal mail client users should be able to have an inbox page showing received message, response to individual email and etc....
The mail client part cannot be an external application, they want everything packaged into a single application!
Normally These emails should be stored for future use
In order to send a receive email, we do not need to setup a mail server. They will provide the server and we will fetch the message with POP3 or something else. Same goes for sending emails.
The application itself often needs to look into these message as well, so it should be able to access corresponding email objects.
Separate part of these applications can be handled with individual gems such as Mailman, ActionMailer, and etc...
But what would be your suggestions to get this done?
I suggestion customizing an open source solution according to your needs. This is a gem/project that you should look at https://github.com/mailboxer/mailboxer It has all the features that you mentioned and its straightforward in its customizations.
What I would like to accomplish is for a user to be able to send an email to a designated email address. Then once that email has been obtained, run a script that parses the body section of the email and carries out various tasks with the information provided in the email
(The data coming in from the email will be structured in an xml type format).
In my mind this seems like a simple task to accomplish but I'm not all that familiar with the inner workings of email. My questions are:
How will I know once an email has been obtained from the sender so that it can be processed?
How can I use php to obtain the text found in the email?
If you have PHP running on your mail server, then it's possible to pipe incoming mail to a PHP script. Then, your PHP script can parse the body of each incoming message as it arrives. See http://harrybailey.com/2009/02/send-or-pipe-an-email-to-a-php-script/ for more info.
I agree with the other responses, that piping to a php application should be your first option (if the mail server and php are the same)
Otherwise if you have an external mail server you will need to poll the email address at regular intervals and check for new emails.
Extracting plain text body from an email message is not too hard, but getting to attachments can be a pain sometimes.
You will need to use a cronjob to trigger your script at regular intervals
To fetch the email from the server and parse it, I have used the php IMAP functions
http://php.net/manual/en/book.imap.php
You can also use 3rd party services like MandrillApp which will receive the message, break it into parts, and call your application via a webhook.
http://help.mandrill.com/entries/21699367-Inbound-Email-Processing-Overview
I am dealing with a bad connection to an external IMAP server. I need my application to download messages from this mail server periodically. On many occasions, my code has already downloaded message using javamail and has executed message.getContent and is then processing individual body parts (attachments). While it is in the process of doing this, the connection can drop.
I need to thus make sure that messages are not marked as SEEN automatically on doing message.getContent, which is how Javamail behaves, as described in this reply here:
https://stackoverflow.com/a/7679091/303106
Is there any way to make sure messages that were not downloaded are not marked as SEEN?
Message msg = ...;
((IMAPMessage)msg).setPeek(true);
Yes, use the BODY.PEEK instead of just BODY when fetching the data, and/or use EXAMINE instead of SELECT to open a mailbox. I'll leave it as an excercise to the reader to read the javamail's documentation to see how these options relate to the features provided by the havamail.
I would like to send a POST request to a server, I don't want to use GET because the sent message could potentially get very long. I was thinking about using javascript and jquery, but I believe most clients have javascript turned off. Is there another way to send a Post request from within an email?
Yea, I've been unable to use javascript, but does anyone else know of a way to make a post request within an outlook mail message?
Probably not. Most javascript is disabled in emails for security purposes so I highly doubt you'll be able to use any server side code via a supported email client like Outlook. I could be wrong though...
How about using a form with hidden inputs for your parameters