Does Indy component suite offers any functions or support or e mail forewarding or reply to ... processing.
I expect the mail body is extended with the sending params. Using other mail programs sometimes the mail text is changed the the > character for each line.
You use TIdPOP3 or TIdIMAP4 to receive emails, and TIdSMTP to send emails. Replying/Forwarding is just a matter of downloading a TIdMessage via POP3/IMAP, updating its Recipients, Subject, etc as needed, and then sending it with SMTP.
Related
I want to parse mails that are send to an IMAP mailbox from my Grails application.
I tried this plugin: https://github.com/IntelliGrape/Grails-Mail-Watcher-Plugin but it does not provide all the functionality I need.
Edit: I need to get the following information from my inbox:
the number of mails
the number of unread mails
the number of read mails
a way to iterate over each mail
I need from the mail:
sender
receiver
subject
date
mail body
mail attachments
mail attachment types
if it is html or plain text mail
How can I read the mails and get the sender, subject, body and attachments?
as i'm not aware of any particular plugin, other the one you already mentioned, you could use the Java Mail API directly. One example of this usage can be found here. The other opportunity is, that you could either extend this plugin (the entry point should be here). The plugin uses the Java Mail API internally as well.
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
Using: Delphi XE2, latest Indy snapshot from SVN (10.6.0.4997)
In the case of IMAP there are 2 properties - UID and MsgID which can be used to uniquely identify a message in a mailbox.
I'm writing an email client, and need to know which is the more reliable or recommended of the two to store everytime the client connects and retrieves the message list.
What sequence of steps are needed to check for new emails? I'm specifically looking for the correct sequence and set of Indy IdIMAP4 commands to get new emails.
Unlike POP3/SMTP, IMAP defines flags on emails. The TIdMessage.Flags property has mfRecent and mfSeen flags available (amongst others). Your client can look for emails that have mfRecent set on them, then update the flags on the server to clear mfRecent and set mfSeen as needed.
My question is how to send a mht message throw Indy 9 with Delphi 7 IDE?
Thanks in advance!
MHT is a format for saving an HTML document and associated resources into a single file. To send such a document as an email, you would have to extract the HTML and resource data first and put them into a TIdMessage component like other HTML-formatted email. There are articles on Indy's website for how to send HTML emails with Indy.
Have a look at RFC 2557 for how MHTML interacts with email.
I am making an application in Delphi 7 and I need to send an email using PageProducer component in order to make it in HTML format. At this point, the objective is to send the email in both formats: text/plain and text/html, but really know how to send it in only one format: either text/plain or text/html. So, how to send an email using PageProducer in both formats: plain and HTML??
I need that because there are webmail servers that don't accept HTML emails.
PageProducer is just a component for producing HTML content by replacing some tags with your specified content. It has no feature for sending emails.
To send email in Delphi 7, you can use IdSMTP component from Indy Clients tab in Components Palette. As it is clear from its name, this component uses SMTP protocol for sending emails.
In your case, you should first generate HTML content using either PageProducer or any other method, and then pass the HTML content to IdSMTP to be sent as an email.
To send an email in both plain text and HTML format you should use multi-part message. You can refer to Indy help for TIdMessage class.
Regards
You should take a look at the MIME format. This is the format the email is finally sent.
If you understand it you will be able to send Multipart messgaes containing text/plain text/html or attachments.
http://en.wikipedia.org/wiki/MIME