EMAIL_RECEIVE Function
Syntax
Arguments
- display_inboxLogical
Defines whether to display the Inbox when email is received. If .T., Display inbox. If .F., Do not display inbox.
- strip_headersLogical
Default = .T. Defines whether to strip headers from the message body and store in separate field (called Headers) in the A_EMAIL.DBF table. If .T., Strip headers. If .F., Do not strip headers
- profileCharacter
The name of your email profile as found on the View > Settings > Email > Profiles tab.
- inboxCharacter
The name of a different in box. The function will create a table with this name.
- filterCharacter
Default = no filter. A character filter expression that evaluates to a logical value and selects email messages to download. The filter applies to header fields.
- lSilentLogical
Default = .F.
Returns
- CountNumeric
Description
Receive email messages using Alpha Anywhere's built-in e-mail facility.
Discussion
EMAIL_RECEIVE() receives an email message using Alpha Anywhere's built-in email features. The function does not require that you have a third party email client (such as Eudora, or Outlook) installed on the computer. Email is received into a table called A_EMAIL.DBF in the Alpha Anywhere program folder.
You can control how many messages Alpha Anywhere will try to retrieve from the mail server, and whether Alpha Anywhere should leave the messages on the server after reading them by adjusting your email settings. To set email settings, select the View > Settings command from the menu, and navigate to the Email category.
Attachments will be stored in the "Attachments" folder off the Alpha Anywhere program folder.
If you put a filter in, EMAIL_RECEIVE() will download all the headers, filter based on the criteria you have specified, and then download only the messages that match the criteria. Any valid RFC822 message header field can be sorted on ( from, to, date, subject, contenttype, etc). If the header field name contains any special characters or spaces, they will be removed. An example of that is "content-type" which would be contenttype. There is also a reserved word, size, that is the size in bytes of the entire message including headers.
Example
Receives an email message using Alpha Anywhere's internal email facility.
email_receive(.T.)
Download only messages less than 1KB.
email_receive(.T., .T., "", "", "Size < 1024")
Other sample filters.
email_receive(.T., .T., "", "", "\"viagra\"" $ subject") email_receive(.T., .T., "", "", "\"[email protected]\" $ from") email_receive(.T., .T., "", "", "Contenttype = "\"text/plain\"")
See Also