Public Member Functions | |
| void | EmailWithAttachment () |
| Boolean | send () |
| Sends the email and attachments by connecting to the server and authorizing via POP. | |
| Boolean | canRun () |
| Determines whether snippet can be run in the current context. | |
| Boolean | run () |
| Functional part of this snippet. | |
| void | close () |
| Closes the socket that was used to transmit data. | |
| Boolean | connect (void host, void port) |
| Attempts to open a socket and connect to a host and port. | |
| void | authorise () |
| Authorizes a username against POP3. | |
| String | encodeAttachment (void binaryString) |
| Accepts a string representing a binary file and encodes it as base64, to allow attachments to be sent via email. | |
| Boolean | doCommand (void cmd, void type) |
| Carries out either an SMTP or a POP command. | |
| void | addAttachment () |
| Adds attachments to the email being sent. | |
| void | buildMessage () |
| Constructs a simple message for the body of the email showing which files are attached. | |
Public Attributes | |
| String | requiredContext |
| The context in which this sample can run. | |
| Socket | password |
| The password for the username - NOTE: You must customize this with your own password value. | |
| String | boundary |
| The boundary for attachments. | |
| String | recipient |
| The address the email will be sent to, the receiver of the email - NOTE: You must customize this with your own recipient address. | |
| String | subject |
| The subject of the email. | |
| int | POP |
| The port number for the POP server, for example port 110 - NOTE: You may need to customize this with your own port number. | |
| String | username |
| The username, not necessarily the email address, to authorize with, for example [email protected] - NOTE: You must customize this with your own username value. | |
| Socket | socket |
| The socket object which this object uses to write to the wire. | |
| String | message |
| The body text of the message. | |
| String | mailServerName |
| The host address for the mail server, for example mail.adomainname.com - NOTE: You must customize this with your own host address value. | |
| String | sender |
The senders email address, for example [email protected]
| |
| int | SMTP |
| The port number for the SMTP server, for example port 25 - NOTE: You may need to customize this with your own port number. | |
| void EmailWithAttachment::EmailWithAttachment | ( | ) |
| Boolean EmailWithAttachment::send | ( | ) |
Sends the email and attachments by connecting to the server and authorizing via POP.
Reestablishes the connection and sends the necessary commands to the SMTP server. If there are attachments to be sent, encodes them into Base64 and writes them to the socket.
| Boolean EmailWithAttachment::canRun | ( | ) |
Determines whether snippet can be run in the current context.
The snippet fails if these preconditions are not met:
| Boolean EmailWithAttachment::run | ( | ) |
Functional part of this snippet.
Runs this sample, calling the helper functions defined below. Creates the Socket object and applies mail settings, such as hostname, password, and so on. You must customize the code so that the mail settings correspond to your mail system and user accounts; otherwise, the sample fails and no emails are sent.
| void EmailWithAttachment::close | ( | ) |
Closes the socket that was used to transmit data.
| Boolean EmailWithAttachment::connect | ( | void | host, | |
| void | port | |||
| ) |
Attempts to open a socket and connect to a host and port.
| host | The host name string of the server to connect to | |
| port | The port number to connect on, an integer |
| void EmailWithAttachment::authorise | ( | ) |
Authorizes a username against POP3.
| String EmailWithAttachment::encodeAttachment | ( | void | binaryString | ) |
Accepts a string representing a binary file and encodes it as base64, to allow attachments to be sent via email.
| binaryString | The string to encode |
| Boolean EmailWithAttachment::doCommand | ( | void | cmd, | |
| void | type | |||
| ) |
Carries out either an SMTP or a POP command.
Separates writing data to the socket and sending commands.
| cmd | The command to be written to the socket | |
| type | One of 'pop' or 'smtp' |
| void EmailWithAttachment::addAttachment | ( | ) |
Adds attachments to the email being sent.
| void EmailWithAttachment::buildMessage | ( | ) |
Constructs a simple message for the body of the email showing which files are attached.
The context in which this sample can run.
The password for the username - NOTE: You must customize this with your own password value.
The boundary for attachments.
The address the email will be sent to, the receiver of the email - NOTE: You must customize this with your own recipient address.
| String EmailWithAttachment::subject |
The subject of the email.
The port number for the POP server, for example port 110 - NOTE: You may need to customize this with your own port number.
The username, not necessarily the email address, to authorize with, for example [email protected] - NOTE: You must customize this with your own username value.
| Socket EmailWithAttachment::socket |
The socket object which this object uses to write to the wire.
| String EmailWithAttachment::message |
The body text of the message.
The host address for the mail server, for example mail.adomainname.com - NOTE: You must customize this with your own host address value.
| String EmailWithAttachment::sender |
The senders email address, for example [email protected]
The port number for the SMTP server, for example port 25 - NOTE: You may need to customize this with your own port number.


Copyright© 2008 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks