错误:This page can't be displayed. Contact support for additional information.

w87786880 2013-01-25 01:10:53
1.网站后台添加新闻,如果是纯文字的内容就没问题,只要是插入图片的话就会报错!
2.其实就是多了一个IMG标签的内容。
3.还有就是在服务器上操作的话,完全没有问题。

错误:
This page can't be displayed. Contact support for additional information.
The incident ID is: 9006017271153621334
...全文
2252 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xinyuanxp 2013-02-20
  • 打赏
  • 举报
回复
是机房硬件防火墙的造成的。跨站点脚本攻击造成的 看看是不是用了这个防火墙。securegrid。
w87786880 2013-01-25
  • 打赏
  • 举报
回复
不知道啊。。一直都没问题的。。昨天就出现这个了。。有人说防火墙问题。我都关闭后也不行。
ImN1 2013-01-25
  • 打赏
  • 举报
回复
这些出错信息不是php的,你要看你使用的框架/软件相关文档
Fundamentals of the JavaMail API Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Tutorial tips 2 2. Introducing the JavaMail API 3 3. Reviewing related protocols 4 4. Installing JavaMail 6 5. Reviewing the core classes 8 6. Using the JavaMail API 13 7. Searching with SearchTerm 21 8. Exercises 22 9. Wrapup 32 Fundamentals of the JavaMail API Page 1 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 1. Tutorial tips Should I take this tutorial? Looking to incorporate mail facilities into your platform-independent Java solutions? Look no further than the JavaMail API, which offers a protocol-independent model for working with IMAP, POP, SMTP, MIME, and all those other Internet-related messaging protocols. With the help of the JavaBeans Activation Framework (JAF), your applications can now be mail-enabled through the JavaMail API. Concepts After completing this module you will understand the: * Basics of the Internet mail protocols SMTP, POP3, IMAP, and MIME * Architecture of the JavaMail framework * Connections between the JavaMail API and the JavaBeans Activation Framework Objectives By the end of this module you will be able to: * Send and read mail using the JavaMail API * Deal with sending and receiving attachments * Work with HTML messages * Use search terms to search for messages Prerequisites Instructions on how to download and install the JavaMail API are contained in the course. In addition, you will need a development environment such as the JDK 1.1.6+ or the Java 2 Platform, Standard Edition (J2SE) 1.2.x or 1.3.x. A general familiarity with object-oriented programming concepts and the Java programming language is necessary. The Java language essentials tutorial can help. copyright 1996-2000 Magelang Institute dba jGuru Contact jGuru has been dedicated to promoting the growth of the Java technology community through evangelism, education, and software since 1995. You can find out more about their activities, including their huge collection of FAQs at jGuru.com . To send feedback to jGuru about this course, send mail to producer@jguru.com . Course author: Formerly with jGuru.com , John Zukowski does strategic Java consulting for JZ Ventures, Inc. His latest book is titled Java Collections from Apress . Fundamentals of the JavaMail API Page 2 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 2. Introducing the JavaMail API What is the JavaMail API? The JavaMail API is an optional package (standard extension) for reading, composing, and sending electronic messages. You use the package to create Mail User Agent (MUA) type programs, similar to Eudora, pine, and Microsoft Outlook. The API's main purpose is not for transporting, delivering, and forwarding messages; this is the purview of applications such as sendmail and other Mail Transfer Agent (MTA) type programs. MUA-type programs let users read and write e-mail, whereas MUAs rely on MTAs to handle the actual delivery. The JavaMail API is designed to provide protocol-independent access for sending and receiving messages by dividing the API into two parts: * The first part of the API is the focus of this course --basically, how to send and receive messages independent of the provider/protocol. * The second part speaks the protocol-specific languages, like SMTP, POP, IMAP, and NNTP. With the JavaMail API, in order to communicate with a server, you need a provider for a protocol. The creation of protocol-specific providers is not covered in this course because Sun provides a sufficient set for free. Fundamentals of the JavaMail API Page 3 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 3. Reviewing related protocols Introduction Before looking into the JavaMail API specifics, let's step back and take a look at the protocols used with the API. There are basically four that you'll come to know and love: * SMTP * POP * IMAP * MIME You will also run across NNTP and some others. Understanding the basics of all the protocols will help you understand how to use the JavaMail API. While the API is designed to be protocol agnostic, you can't overcome the limitations of the underlying protocols. If a capability isn't supported by a chosen protocol, the JavaMail API doesn't magically add the capability on top of it. (As you'll soon see, this can be a problem when working with POP.) SMTP The Simple Mail Transfer Protocol (SMTP) is defined by RFC 821 . It defines the mechanism for delivery of e-mail. In the context of the JavaMail API, your JavaMail-based program will communicate with your company or Internet Service Provider's (ISP's) SMTP server. That SMTP server will relay the message on to the SMTP server of the recipient(s) to eventually be acquired by the user(s) through POP or IMAP. This does not require your SMTP server to be an open relay, as authentication is supported, but it is your responsibility to ensure the SMTP server is configured properly. There is nothing in the JavaMail API for tasks like configuring a server to relay messages or to add and remove e-mail accounts. POP POP stands for Post Office Protocol. Currently in version 3, also known as POP3, RFC 1939 defines this protocol. POP is the mechanism most people on the Internet use to get their mail. It defines support for a single mailbox for each user. That is all it does, and that is also the source of a lot of confusion. Much of what people are familiar with when using POP, like the ability to see how many new mail messages they have, are not supported by POP at all. These capabilities are built into programs like Eudora or Microsoft Outlook, which remember things like the last mail received and calculate how many are new for you. So, when using the JavaMail API, if you want this type of information, you have to calculate it yourself. IMAP IMAP is a more advanced protocol for receiving messages. Defined in RFC 2060 , IMAP stands for Internet Message Access Protocol, and is currently in version 4, also known as IMAP4. When using IMAP, your mail server must support the protocol. You can't just change your program to use IMAP instead of POP and expect everything in IMAP to be supported. Assuming your mail server supports IMAP, your JavaMail-based program can take Fundamentals of the JavaMail API Page 4 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks advantage of users having multiple folders on the server and these folders can be shared by multiple users. Due to the more advanced capabilities, you might think IMAP would be used by everyone. It isn't. It places a much heavier burden on the mail server, requiring the server to receive the new messages, deliver them to users when requested, and maintain them in multiple folders for each user. While this does centralize backups, as users' long-term mail folders get larger and larger, everyone suffers when disk space is exhausted. With POP, saved messages get offloaded from the mail server. MIME MIME stands for Multipurpose Internet Mail Extensions. It is not a mail transfer protocol. Instead, it defines the content of what is transferred: the format of the messages, attachments, and so on. There are many different documents that take effect here: RFC 822 , RFC 2045 , RFC 2046 , and RFC 2047 . As a user of the JavaMail API, you usually don't need to worry about these formats. However, these formats do exist and are used by your programs. NNTP and others Because of the split of the JavaMail API between provider and everything else, you can easily add support for additional protocols. Sun maintains a list of third-party providers that take advantage of protocols for which Sun does not provide out-of-the-box support. You'll find support for NNTP (Network News Transport Protocol) [newsgroups], S/MIME (Secure Multipurpose Internet Mail Extensions), and more. Fundamentals of the JavaMail API Page 5 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 4. Installing JavaMail Introduction There are two versions of the JavaMail API commonly used today: 1.2 and 1.1.3. All the examples in this course will work with both. While 1.2 is the latest, 1.1.3 is the version included with the 1.2.1 version of the Java 2 Platform, Enterprise Edition (J2EE), so it is still commonly used. The version of the JavaMail API you want to use affects what you download and install. All will work with JDK 1.1.6+, Java 2 Platform, Standard Edition (J2SE) version 1.2.x, and J2SE version 1.3.x. Note: After installing Sun's JavaMail implementation, you can find many example programs in the demo directory. Installing JavaMail 1.2 To use the JavaMail 1.2 API, download the JavaMail 1.2 implementation, unbundle the javamail-1_2.zip file, and add the mail.jar file to your CLASSPATH. The 1.2 implementation comes with an SMTP, IMAP4, and POP3 provider besides the core classes. After installing JavaMail 1.2, install the JavaBeans Activation Framework. Installing JavaMail 1.1.3 To use the JavaMail 1.1.3 API, download the JavaMail 1.1.3 implementation, unbundle the javamail1_1_3.zip file, and add the mail.jar file to your CLASSPATH. The 1.1.3 implementation comes with an SMTP and IMAP4 provider, besides the core classes. If you want to access a POP server with JavaMail 1.1.3, download and install a POP3 provider. Sun has one available separate from the JavaMail implementation. After downloading and unbundling pop31_1_1.zip, add pop3.jar to your CLASSPATH, too. After installing JavaMail 1.1.3, install the JavaBeans Activation Framework. Installing the JavaBeans Activation Framework All versions of the JavaMail API require the JavaBeans Activation Framework. The framework adds support for typing arbitrary blocks of data and handling it accordingly. This doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools today. After downloading the framework, unbundle the jaf1_0_1.zip file, and add the activation.jar file to your CLASSPATH. For JavaMail 1.2 users, you should now have added mail.jar and activation.jar to your CLASSPATH. For JavaMail 1.1.3 users, you should now have added mail.jar, pop3.jar, and activation.jar to your CLASSPATH. If you have no plans of using POP3, you don't Fundamentals of the JavaMail API Page 6 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks need to add pop3.jar to your CLASSPATH. If you don't want to change the CLASSPATH environment variable, copy the jar files to your lib/ext directory under the Java Runtime Environment (JRE) directory. For instance, for the J2SE 1.3 release, the default directory would be C:\jdk1.3\jre\lib\ext on a Windows platform. Using JavaMail with the Java 2 Enterprise Edition If you use J2EE, there is nothing special you have to do to use the basic JavaMail API; it comes with the J2EE classes. Just make sure the j2ee.jar file is in your CLASSPATH and you're all set. For J2EE 1.2.1, the POP3 provider comes separately, so download and follow the steps to include the POP3 provider as shown in the previous section "Installing JavaMail 1.1.3." J2EE 1.3 users get the POP3 provider with J2EE so do not require the separate installation. Neither installation requires you to install the JavaBeans Activation Framework. Exercise Exercise 1. How to set up a JavaMail environment on page 22 Fundamentals of the JavaMail API Page 7 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 5. Reviewing the core classes Introduction Before taking a how-to approach at looking at the JavaMail classes in depth, this section walks you through the core classes that make up the API: Session, Message, Address, Authenticator, Transport, Store, and Folder. All these classes are found in the top-level package for the JavaMail API, javax.mail, though you'll frequently find yourself using subclasses found in the javax.mail.internet package. Session The Session class defines a basic mail session. It is through this session that everything else works. The Session object takes advantage of a java.util.Properties object to get information like mail server, username, password, and other information that can be shared across your entire application. The constructors for the class are private. You can get a single default session that can be shared with the getDefaultInstance() method: Properties props = new Properties(); // fill props with any information Session session = Session.getDefaultInstance(props, null); Or, you can create a unique session with getInstance(): Properties props = new Properties(); // fill props with any information Session session = Session.getDefaultInstance(props, null); In both cases, the null argument is an Authenticator object that is not being used at this time. In most cases, it is sufficient to use the shared session, even if working with mail sessions for multiple user mailboxes. You can add the username and password combination in at a later step in the communication process, keeping everything separate. Message Once you have your Session object, it is time to move on to creating the message to send. This is done with a type of Message . Because Message is an abstract class, you must work with a subclass, in most cases javax.mail.internet.MimeMessage .A MimeMessage is an e-mail message that understands MIME types and headers, as defined in the different RFCs. Message headers are restricted to US-ASCII characters only, though non-ASCII characters can be encoded in certain header fields. To create a Message, pass along the Session object to the MimeMessage constructor: MimeMessage message = new MimeMessage(session); Fundamentals of the JavaMail API Page 8 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Note: There are other constructors, like for creating messages from RFC822-formatted input streams. Once you have your message, you can set its parts, as Message implements the Part interface (with MimeMessage implementing MimePart ). The basic mechanism to set the content is the setContent() method, with arguments for the content and the mime type: message.setContent("Hello", "text/plain"); If, however, you know you are working with a MimeMessage and your message is plain text, you can use its setText() method, which only requires the actual content, defaulting to the MIME type of text/plain: message.setText("Hello"); For plain text messages, the latter form is the preferred mechanism to set the content. For sending other kinds of messages, like HTML messages, use the former. For setting the subject, use the setSubject() method: message.setSubject("First"); Address Once you've created the Session and the Message, as well as filled the message with content, it is time to address your letter with an Address . Like Message, Address is an abstract class. You use the javax.mail.internet.InternetAddress class. To create an address with just the e-mail address, pass the e-mail address to the constructor: Address address = new InternetAddress("president@whitehouse.gov"); If you want a name to appear next to the e-mail address, you can pass that along to the constructor, too: Address address = new InternetAddress("president@whitehouse.gov", "George Bush"); You will need to create address objects for the message's from field as well as the to field. Unless your mail server prevents you, there is nothing stopping you from sending a message that appears to be from anyone. Once you've created the addresses, you connect them to a message in one of two ways. For identifying the sender, you use the setFrom() and setReplyTo() methods. message.setFrom(address) If your message needs to show multiple from addresses, use the addFrom() method: Fundamentals of the JavaMail API Page 9 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Address address[] = ...; message.addFrom(address); For identifying the message recipients, you use the addRecipient() method. This method requires a Message.RecipientType besides the address. message.addRecipient(type, address) The three predefined types of address are: * Message.RecipientType.TO * Message.RecipientType.CC * Message.RecipientType.BCC So, if the message was to go to the vice president, sending a carbon copy to the first lady, the following would be appropriate: Address toAddress = new InternetAddress("vice.president@whitehouse.gov"); Address ccAddress = new InternetAddress("first.lady@whitehouse.gov"); message.addRecipient(Message.RecipientType.TO, toAddress); message.addRecipient(Message.RecipientType.CC, ccAddress); The JavaMail API provides no mechanism to check for the validity of an e-mail address. While you can program in support to scan for valid characters (as defined by RFC 822) or verify the MX (mail exchange) record yourself, these are all beyond the scope of the JavaMail API. Authenticator Like the java.net classes, the JavaMail API can take advantage of an Authenticator to access protected resources via a username and password. For the JavaMail API, that resource is the mail server. The JavaMail Authenticator is found in the javax.mail package and is different from the java.net class of the same name. The two don't share the same Authenticator as the JavaMail API works with Java 1.1, which didn't have the java.net variety. To use the Authenticator, you subclass the abstract class and return a PasswordAuthentication instance from the getPasswordAuthentication() method. You must register the Authenticator with the session when created. Then, your Authenticator will be notified when authentication is necessary. You could pop up a window or read the username and password from a configuration file (though if not encrypted is not secure), returning them to the caller as a PasswordAuthentication object. Properties props = new Properties(); // fill props with any information Authenticator auth = new MyAuthenticator(); Session session = Session.getDefaultInstance(props, auth); Transport The final part of sending a message is to use the Transport class. This class speaks the Fundamentals of the JavaMail API Page 10 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks protocol-specific language for sending the message (usually SMTP). It's an abstract class and works something like Session. You can use the default version of the class by just calling the static send() method: Transport.send(message); Or, you can get a specific instance from the session for your protocol, pass along the username and password (blank if unnecessary), send the message, and close the connection: message.saveChanges(); // implicit with send() Transport transport = session.getTransport("smtp"); transport.connect(host, username, password); transport.sendMessage(message, message.getAllRecipients()); transport.close(); This latter way is best when you need to send multiple messages, as it will keep the connection with the mail server active between messages. The basic send() mechanism makes a separate connection to the server for each method call. Note: To watch the mail commands go by to the mail server, set the debug flag with session.setDebug(true). Store and folder Getting messages starts similarly to sending messages with a Session. However, after getting the session, you connect to a Store , quite possibly with a username and password or Authenticator. Like Transport, you tell the Store what protocol to use: // Store store = session.getStore("imap"); Store store = session.getStore("pop3"); store.connect(host, username, password); After connecting to the Store, you can then get a Folder , which must be opened before you can read messages from it: Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); Message message[] = folder.getMessages(); For POP3, the only folder available is the INBOX. If you are using IMAP, you can have other folders available. Note: Sun's providers are meant to be smart. While Message message[] = folder.getMessages(); might look like a slow operation reading every message from the server, only when you actually need to get a part of the message is the message content retrieved. Once you have a Message to read, you can get its content with getContent() or write its content to a stream with writeTo(). The getContent() method only gets the message content, while writeTo() output includes headers. Fundamentals of the JavaMail API Page 11 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks System.out.println(((MimeMessage)message).getContent()); Once you're done reading mail, close the connection to the folder and store. folder.close(aBoolean); store.close(); The boolean passed to the close() method of folder states whether or not to update the folder by removing deleted messages. Moving on Essentially, understanding how to use these seven classes is all you need for nearly everything with the JavaMail API. Most of the other capabilities of the JavaMail API build off these seven classes to do something a little different or in a particular way, like if the content is an attachment. Certain tasks, like searching, are isolated and are discussed later. Fundamentals of the JavaMail API Page 12 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 6. Using the JavaMail API Introduction You've seen how to work with the core parts of the JavaMail API. In the following sections you'll find a how-to approach for connecting the pieces to do specific tasks. Sending messages Sending an e-mail message involves getting a session, creating and filling a message, and sending it. You can specify your SMTP server by setting the mail.smtp.host property for the Properties object passed when getting the Session: String host = ...; String from = ...; String to = ...; // Get system properties Properties props = System.getProperties(); // Setup mail server props.put("mail.smtp.host", host); // Get session Session session = Session.getDefaultInstance(props, null); // Define message MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject("Hello JavaMail"); message.setText("Welcome to JavaMail"); // Send message Transport.send(message); You should place the code in a try-catch block, as setting up the message and sending it can throw exceptions. Exercise: Exercise 2. How to send your first message on page 23 Fetching messages For reading mail, you get a session, get and connect to an appropriate store for your mailbox, open the appropriate folder, and get your messages. Also, don't forget to close the connection when done. String host = ...; String username = ...; String password = ...; // Create empty properties Properties props = new Properties(); // Get session Session session = Session.getDefaultInstance(props, null); Fundamentals of the JavaMail API Page 13 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks // Get the store Store store = session.getStore("pop3"); store.connect(host, username, password); // Get folder Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); // Get directory Message message[] = folder.getMessages(); for (int i=0, n=message.length; ialse); store.close(); What you do with each message is up to you. The above code block just displays whom the message is from and the subject. Technically speaking, the list of from addresses could be empty and the getFrom()[0] call could throw an exception. To display the whole message, you can prompt the user after seeing the from and subject fields, and then call the message's writeTo() method if the user wants to see it. BufferedReader reader = new BufferedReader ( new InputStreamReader(System.in)); // Get directory Message message[] = folder.getMessages(); for (int i=0, n=message.length; ials(line)) { message[i].writeTo(System.out); } else if ("QUIT".equals(line)) { break; } } Exercise: Exercise 3. How to check for mail on page 25 Deleting messages and flags Deleting messages involves working with the Flags associated with the messages. There are different flags for different states, some system-defined and some user-defined. The predefined flags are defined in the inner class Flags.Flag and are listed below: * Flags.Flag.ANSWERED * Flags.Flag.DELETED * Flags.Flag.DRAFT * Flags.Flag.FLAGGED * Flags.Flag.RECENT * Flags.Flag.SEEN * Flags.Flag.USER Fundamentals of the JavaMail API Page 14 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Just because a flag exists doesn't mean the flag is supported by all mail servers or providers. For instance, except for deleting messages, the POP protocol supports none of them. Checking for new mail is not a POP task but a task built into mail clients. To find out what flags are supported, ask the folder with getPermanentFlags(). To delete messages, you set the message's DELETED flag: message.setFlag(Flags.Flag.DELETED, true); Open up the folder in READ_WRITE mode first though: folder.open(Folder.READ_WRITE); Then, when you are done processing all messages, close the folder, passing in a true value to expunge the deleted messages. folder.close(true); There is an expunge() method of Folder that can be used to delete the messages. However, it doesn't work for Sun's POP3 provider. Other providers may or may not implement the capabilities. It will more than likely be implemented for IMAP providers. Because POP only supports single access to the mailbox, you have to close the folder to delete the messages with Sun's provider. To unset a flag, just pass false to the setFlag() method. To see if a flag is set, check it with isSet(). Authenticating yourself You learned that you can use an Authenticator to prompt for username and password when needed, instead of passing them in as strings. Here you'll actually see how to more fully use authentication. Instead of connecting to the Store with the host, username, and password, you configure the Properties to have the host, and tell the Session about your custom Authenticator instance, as shown here: // Setup properties Properties props = System.getProperties(); props.put("mail.pop3.host", host); // Setup authentication, get session Authenticator auth = new PopupAuthenticator(); Session session = Session.getDefaultInstance(props, auth); // Get the store Store store = session.getStore("pop3"); store.connect(); You then subclass Authenticator and return a PasswordAuthentication object from the getPasswordAuthentication() method. The following is one such implementation, with a single field for both. (This isn't a Project Swing tutorial; just enter the two parts in the one field, separated by a comma.) Fundamentals of the JavaMail API Page 15 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks import javax.mail.*; import javax.swing.*; import java.util.*; public class PopupAuthenticator extends Authenticator { public PasswordAuthentication getPasswordAuthentication() { String username, password; String result = JOptionPane.showInputDialog( "Enter 'username,password'"); StringTokenizer st = new StringTokenizer(result, ","); username = st.nextToken(); password = st.nextToken(); return new PasswordAuthentication(username, password); } } Because the PopupAuthenticator relies on Swing, it will start up the event-handling thread for AWT. This basically requires you to add a call to System.exit() in your code to stop the program. Replying to messages The Message class includes a reply() method to configure a new Message with the proper recipient and subject, adding "Re: " if not already there. This does not add any content to the message, only copying the from or reply-to header to the new recipient. The method takes a boolean parameter indicating whether to reply to only the sender (false) or reply to all (true). MimeMessage reply = (MimeMessage)message.reply(false); reply.setFrom(new InternetAddress("president@whitehouse.gov")); reply.setText("Thanks"); Transport.send(reply); To configure the reply-to address when sending a message, use the setReplyTo() method. Exercise: Exercise 4. How to reply to mail on page 27 Forwarding messages Forwarding messages is a little more involved. There is no single method to call, and you build up the message to forward by working with the parts that make up a message. A mail message can be made up of multiple parts. Each part is a BodyPart , or more specifically, a MimeBodyPart when working with MIME messages. The different body parts get combined into a container called Multipart or, again, more specifically a MimeMultipart . To forward a message, you create one part for the text of your message and a second part with the message to forward, and combine the two into a multipart. Then you add the multipart to a properly addressed message and send it. That's essentially it. To copy the content from one message to another, just copy over its Fundamentals of the JavaMail API Page 16 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks DataHandler , a class from the JavaBeans Activation Framework. // Create the message to forward Message forward = new MimeMessage(session); // Fill in header forward.setSubject("Fwd: " + message.getSubject()); forward.setFrom(new InternetAddress(from)); forward.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); // Create your new message part BodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setText( "Here you go with the original message:\n\n"); // Create a multi-part to combine the parts Multipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); // Create and fill part for the forwarded content messageBodyPart = new MimeBodyPart(); messageBodyPart.setDataHandler(message.getDataHandler()); // Add part to multi part multipart.addBodyPart(messageBodyPart); // Associate multi-part with message forward.setContent(multipart); // Send message Transport.send(forward); Working with attachments Attachments are resources associated with a mail message, usually kept outside of the message like a text file, spreadsheet, or image. As with common mail programs like Eudora and pine, you can attach resources to your mail message with the JavaMail API and get those attachments when you receive the message. Sending attachments: Sending attachments is quite like forwarding messages. You build up the parts to make the complete message. After the first part, your message text, you add other parts where the DataHandler for each is your attachment, instead of the shared handler in the case of a forwarded message. If you are reading the attachment from a file, your attachment data source is a FileDataSource . Reading from a URL, it is a URLDataSource . Once you have your DataSource, just pass it on to the DataHandler constructor, before finally attaching it to the BodyPart with setDataHandler(). Assuming you want to retain the original filename for the attachment, the last thing to do is to set the filename associated with the attachment with the setFileName() method of BodyPart. All this is shown here: // Define message Message message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject("Hello JavaMail Attachment"); // Create the message part BodyPart messageBodyPart = new MimeBodyPart(); // Fill the message messageBodyPart.setText("Pardon Ideas"); Fundamentals of the JavaMail API Page 17 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Multipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); // Part two is attachment messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(filename); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); multipart.addBodyPart(messageBodyPart); // Put parts in message message.setContent(multipart); // Send the message Transport.send(message); When including attachments with your messages, if your program is a servlet, your users must upload the attachment besides telling you where to send the message. Uploading each file can be handled with a form encoding type of multipart/form-data.
ALUE="Upload">
Note: Message size is limited by your SMTP server, not the JavaMail API. If you run into problems, consider increasing the Java heap size by setting the ms and mx parameters. Exercise: Exercise 5. How to send attachments on page 28 Getting attachments: Getting attachments out of your messages is a little more involved then sending them because MIME has no simple notion of attachments. The content of your message is a Multipart object when it has attachments. You then need to process each Part, to get the main content and the attachment(s). Parts marked with a disposition of Part.ATTACHMENT from part.getDisposition() are clearly attachments. However, attachments can also come across with no disposition (and a non-text MIME type) or a disposition of Part.INLINE. When the disposition is either Part.ATTACHMENT or Part.INLINE, you can save off the content for that message part. Just get the original filename with getFileName() and the input stream with getInputStream(). Multipart mp = (Multipart)message.getContent(); for (int i=0, n=multipart.getCount(); ials(Part.ATTACHMENT) || (disposition.equals(Part.INLINE))) { saveFile(part.getFileName(), part.getInputStream()); } } The saveFile() method just creates a File from the filename, reads the bytes from the input stream, and writes them off to the file. In case the file already exists, a number is added to the end of the filename until one is found that doesn't exist. // from saveFile() File file = new File(filename); Fundamentals of the JavaMail API Page 18 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks for (int i=0; file.exists(); i++) { file = new File(filename+i); } The code above covers the simplest case where message parts are flagged appropriately. To cover all cases, handle when the disposition is null and get the MIME type of the part to handle accordingly. if (disposition == null) { // Check if plain MimeBodyPart mbp = (MimeBodyPart)part; if (mbp.isMimeType("text/plain")) { // Handle plain } else { // Special non-attachment cases here of image/gif, text/html, ... } ... } Processing HTML messages Sending HTML-based messages can be a little more work than sending plain text message, though it doesn't have to be that much more work. It all depends on your specific requirements. Sending HTML messages: If all you need to do is send the equivalent of an HTML file as the message and let the mail reader worry about fetching any embedded images or related pieces, use the setContent() method of Message, passing along the content as a String and setting the content type to text/html. String htmlText = "

Hello

" + ""; message.setContent(htmlText, "text/html")); On the receiving end, if you fetch the message with the JavaMail API, there is nothing built into the API to display the message as HTML. The JavaMail API only sees it as a stream of bytes. To display the message as HTML, you must either use the Swing JEditorPane or some third-party HTML viewer component. if (message.getContentType().equals("text/html")) { String content = (String)message.getContent(); JFrame frame = new JFrame(); JEditorPane text = new JEditorPane("text/html", content); text.setEditable(false); JScrollPane pane = new JScrollPane(text); frame.getContentPane().add(pane); frame.setSize(300, 300); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.show(); } Including images with your messages: On the other hand, if you want your HTML content message to be complete, with embedded images included as part of the message, you must treat the image as an attachment and reference the image with a special cid URL, where the cid is a reference to the Content-ID header of the image attachment. The process of embedding an image is quite similar to attaching a file to a message, the only Fundamentals of the JavaMail API Page 19 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks difference is you have to tell the MimeMultipart that the parts are related by setting its subtype in the constructor (or with setSubType()) and set the Content-ID header for the image to a random string which is used as the src for the image in the img tag. The following demonstrates this completely. String file = ...; // Create the message Message message = new MimeMessage(session); // Fill its headers message.setSubject("Embedded Image"); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); // Create your new message part BodyPart messageBodyPart = new MimeBodyPart(); String htmlText = "

Hello

" + ""; messageBodyPart.setContent(htmlText, "text/html"); // Create a related multi-part to combine the parts MimeMultipart multipart = new MimeMultipart("related"); multipart.addBodyPart(messageBodyPart); // Create part for the image messageBodyPart = new MimeBodyPart(); // Fetch the image and associate to part DataSource fds = new FileDataSource(file); messageBodyPart.setDataHandler(new DataHandler(fds)); messageBodyPart.setHeader("Content-ID","memememe"); // Add part to multi-part multipart.addBodyPart(messageBodyPart); // Associate multi-part with message message.setContent(multipart); Exercise: Exercise 6. How to send HTML messages with images on page 29 Fundamentals of the JavaMail API Page 20 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 7. Searching with SearchTerm Introduction The JavaMail API includes a filtering mechanism found in the javax.mail.search package to build up a SearchTerm . Once built, you then ask a Folder what messages match, retrieving an array of Message objects: SearchTerm st = ...; Message[] msgs = folder.search(st); There are 22 different classes available to help you build a search term. * AND terms (class AndTerm) * OR terms (class OrTerm) * NOT terms (class NotTerm) * SENT DATE terms (class SentDateTerm) * CONTENT terms (class BodyTerm) * HEADER terms (FromTerm / FromStringTerm, RecipientTerm / RecipientStringTerm, SubjectTerm, etc..) Essentially, you build up a logical expression for matching messages, then search. For instance the following term searches for messages with a (partial) subject string of ADV or a from field of friend@public.com. You might consider periodically running this query and automatically deleting any messages returned. SearchTerm st = new OrTerm( new SubjectTerm("ADV:"), new FromStringTerm("friend@public.com")); Message[] msgs = folder.search(st); Fundamentals of the JavaMail API Page 21 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 8. Exercises About the exercises These exercises are designed to provide help according to your needs. For example, you might simply complete the exercise given the information and the task list in the exercise body; you might want a few hints; or you may want a step-by-step guide to successfully complete a particular exercise. You can use as much or as little help as you need per exercise. Moreover, because complete solutions are also provided, you can skip a few exercises and still be able to complete future exercises requiring the skipped ones. Each exercise has a list of any prerequisite exercises, a list of skeleton code for you to start with, links to necessary API pages, and a text description of the exercise goal. In addition, there is help for each task and a solutions page with links to files that comprise a solution to the exercise. Exercise 1. How to set up a JavaMail environment In this exercise you will install Sun's JavaMail reference implementation. After installing, you will be introduced to the demonstration programs that come with the reference implementation. Task 1: Download the latest version of the JavaMail API implementation from Sun. Task 2: Download the latest version of the JavaBeans Activation Framework from Sun. Task 3: Unzip the downloaded packages. You get a ZIP file for all platforms for both packages. Help for task 3: You can use the jar tool to unzip the packages. Task 4: Add the mail.jar file from the JavaMail 1.2 download and the activation.jar file from the JavaBeans Activation Framework download to your CLASSPATH. Help for task 4: Copy the files to your extension library directory. For Microsoft Windows, using the default installation copy, the command might look like the following: cd \javamail-1.2 copy mail.jar \jdk1.3\jre\lib\ext cd \jaf-1.0.1 copy activation.jar \jdk1.3\jre\lib\ext If you don't like copying the files to the extension library directory, detailed instructions are available from Sun for setting your CLASSPATH on Windows NT. Task 5: Go into the demo directory that comes with the JavaMail API implementation and compile the msgsend program to send a test message. Help for task 5: javac msgsend.java Fundamentals of the JavaMail API Page 22 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Task 6: Execute the program passing in a from address with the -o option, your SMTP server with the -M option, and the to address (with no option). You'll then enter the subject, the text of your message, and the end-of-file character (CTRL-Z) to signal the end of the message input. Help for task 6: Be sure to replace the from address, SMTP server, and to address. java msgsend -o from@address -M SMTP.Server to@address If you are not sure of your SMTP server, contact your system administrator or check with your Internet Service Provider. Task 7: Check to make sure you received the message with your normal mail reader (Eudora, Outlook Express, pine, ...). Exercise 1. How to set up a JavaMail environment: Solution Upon successful completion, the JavaMail reference implementation will be in your CLASSPATH. Exercise 2. How to send your first message In the last exercise you sent a mail message using the demonstration program provided with the JavaMail implementation. In this exercise, you'll create the program yourself. For more help with exercises, see About the exercises on page 22 . Prerequisites: * Exercise 1. How to set up a JavaMail environment on page 22 Skeleton code: * MailExample.java Task 1: Starting with the skeleton code , get the system Properties. Help for task 1: Properties props = System.getProperties(); Task 2: Add the name of your SMTP server to the properties for the mail.smtp.host key. Fundamentals of the JavaMail API Page 23 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Help for task 2: props.put("mail.smtp.host", host); Task 3: Get a Session object based on the Properties. Help for task 3: Session session = Session.getDefaultInstance(props, null); Task 4: Create a MimeMessage from the session. Help for task 4: MimeMessage message = new MimeMessage(session); Task 5: Set the from field of the message. Help for task 5: message.setFrom(new InternetAddress(from)); Task 6: Set the to field of the message. Help for task 6: message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); Task 7: Set the subject of the message. Help for task 7: message.setSubject("Hello JavaMail"); Task 8: Set the content of the message. Help for task 8: message.setText("Welcome to JavaMail"); Task 9: Use a Transport to send the message. Help for task 9: Transport.send(message); Task 10: Compile and run the program, passing your SMTP server, from address, and to address on the command line. Fundamentals of the JavaMail API Page 24 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Help for task 10: java MailExample SMTP.Server from@address to@address Task 11: Check to make sure you received the message with your normal mail reader (Eudora, Outlook Express, pine, ...). Exercise 2. How to send your first message: Solution The following Java source file represents a solution to this exercise: * Solution/MailExample.java Exercise 3. How to check for mail In this exercise, create a program that displays the from address and subject for each message and prompts to display the message content. For more help with exercises, see About the exercises on page 22 . Prerequisites: * Exercise 1. How to set up a JavaMail environment on page 22 Skeleton Code * GetMessageExample.java Task 1: Starting with the skeleton code , get or create a Properties object. Help for task 1: Properties props = new Properties(); Task 2: Get a Session object based on the Properties. Help for task 2: Session session = Session.getDefaultInstance(props, null); Task 3: Get a Store for your e-mail protocol, either pop3 or imap. Help for task 3: Store store = session.getStore("pop3"); Task 4: Connect to your mail host's store with the appropriate username and password. Fundamentals of the JavaMail API Page 25 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Help for task 4: store.connect(host, username, password); Task 5: Get the folder you want to read. More than likely, this will be the INBOX. Help for task 5: Folder folder = store.getFolder("INBOX"); Task 6: Open the folder read-only. Help for task 6: folder.open(Folder.READ_ONLY); Task 7: Get a directory of the messages in the folder. Save the message list in an array variable named message. Help for task 7: Message message[] = folder.getMessages(); Task 8: For each message, display the from field and the subject. Help for task 8: System.out.println(i + ": " + message[i].getFrom()[0] + "\t" + message[i].getSubject()); Task 9: Display the message content when prompted. Help for task 9: System.out.println(message[i].getContent()); Task 10: Close the connection to the folder and store. Help for task 10: folder.close(false); store.close(); Task 11: Compile and run the program, passing your mail server, username, and password on the command line. Answer YES to the messages you want to read. Just hit ENTER if you don't. If you want to stop reading your mail before making your way through all the messages, enter QUIT. Help for task 11: java GetMessageExample POP.Server username password Fundamentals of the JavaMail API Page 26 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Exercise 3. How to check for mail: Solution The following Java source file represents a solution to this exercise. * Solution/GetMessageExample.java Exercise 4. How to reply to mail In this exercise, create a program that creates a canned reply message and attaches the original message if it's plain text. For more help with exercises, see About the exercises on page 22 . Prerequisites: * Exercise 3. How to check for mail on page 25 Skeleton Code: * ReplyExample.java Task 1: The skeleton code already includes the code to get the list of messages from the folder and prompt you to create a reply. Task 2: When answered affirmatively, create a new MimeMessage from the original message. Help for task 2: MimeMessage reply = (MimeMessage)message[i].reply(false); Task 3: Set the from field to your e-mail address. Task 4: Create the text for the reply. Include a canned message to start. When the original message is plain text, add each line of the original message, prefix each line with the "> " characters. Help for task 4: To check for plain text messages, check the messages MIME type with mimeMessage.isMimeType("text/plain"). Task 5: Set the message's content, once the message content is fully determined. Task 6: Send the message. Task 7: Compile and run the program, passing your mail server, SMTP server, username, password, and from address on the command line. Answer YES to the messages you want to send replies. Just hit ENTER if you don't. If you want to stop going through your mail before Fundamentals of the JavaMail API Page 27 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks making your way through all the messages, enter QUIT. Help for task 7: java ReplyExample POP.Server SMTP.Server username password from@address Task 8: Check to make sure you received the message with your normal mail reader (Eudora, Outlook Express, pine, ...). Exercise 4. How to reply to mail: Solution The following Java source file represents a solution to this exercise. * Solution/ReplyExample.java Exercise 5. How to send attachments In this exercise, create a program that sends a message with an attachment. For more help with exercises, see About the exercises on page 22 . Prerequisites: * Exercise 2. How to send your first message on page 23 Skeleton Code: * AttachExample.java Task 1: The skeleton code already includes the code to get the initial mail session. Task 2: From the session, get a Message and set its header fields: to, from, and subject. Task 3: Create a BodyPart for the main message content and fill its content with the text of the message. Help for task 3: BodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setText("Here's the file"); Task 4: Create a Multipart to combine the main content with the attachment. Add the main content to the multipart. Help for task 4: Multipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); Fundamentals of the JavaMail API Page 28 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Task 5: Create a second BodyPart for the attachment. Task 6: Get the attachment as a DataSource. Help for task 6: DataSource source = new FileDataSource(filename); Task 7: Set the DataHandler for the message part to the data source. Carry the original filename along. Help for task 7: messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); Task 8: Add the second part of the message to the multipart. Task 9: Set the content of the message to the multipart. Help for task 9: message.setContent(multipart); Task 10: Send the message. Task 11: Compile and run the program, passing your SMTP server, from address, to address, and filename on the command line. This will send the file as an attachment. Help for task 11: java AttachExample SMTP.Server from@address to@address filename Task 12: Check to make sure you received the message with your normal mail reader (Eudora, Outlook Express, pine, ...). Exercise 5. How to send attachments: Solution The following Java source file represents a solution to this exercise. * Solution/AttachExample.java Exercise 6. How to send HTML messages with images In this exercise, create a program that sends an HTML message with an image attachment where the image is displayed within the HTML message. Fundamentals of the JavaMail API Page 29 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks For more help with exercises, see About the exercises on page 22 . Prerequisites: * Exercise 5. How to send attachments on page 28 Skeleton code: * logo.gif * HtmlImageExample.java Task 1: The skeleton code already includes the code to get the initial mail session, create the main message, and fill its headers (to, from, subject). Task 2: Create a BodyPart for the HTML message content. Task 3: Create a text string of the HTML content. Include a reference in the HTML to an image () that is local to the mail message. Help for task 3: Use a cid URL. The content-id will need to be specified for the image later. String htmlText = "

Hello

" + ""; Task 4: Set the content of the message part. Be sure to specify the MIME type is text/html. Help for task 4: messageBodyPart.setContent(htmlText, "text/html"); Task 5: Create a Multipart to combine the main content with the attachment. Be sure to specify that the parts are related. Add the main content to the multipart. Help for task 5: MimeMultipart multipart = new MimeMultipart("related"); multipart.addBodyPart(messageBodyPart); Task 6: Create a second BodyPart for the attachment. Task 7: Get the attachment as a DataSource, and set the DataHandler for the message part to the data source. Task 8: Set the Content-ID header for the part to match the image reference specified in the HTML. Help for task 8: messageBodyPart.setHeader("Content-ID","memememe"); Task 9: Add the second part of the message to the multipart, and set the content of the Fundamentals of the JavaMail API Page 30 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks message to the multipart. Task 10: Send the message. Task 11: Compile and run the program, passing your SMTP server, from address, to address, and filename on the command line. This will send the images as an inline image within the HTML text. Help for task 11: java HtmlImageExample SMTP.Server from@address to@address filename Task 12: Check if your mail reader recognizes the message as HTML and displays the image within the message, instead of as a link to an external attachment file. Help for task 12: If your mail reader can't display HTML messages, consider sending the message to a friend. Exercise 6. How to send HTML messages with images: Solution The following Java source files represent a solution to this exercise. * Solution/logo.gif * Solution/HtmlImageExample.java Fundamentals of the JavaMail API Page 31 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Section 9. Wrapup In summary The JavaMail API is a Java package used for reading, composing, and sending e-mail messages and their attachments. It lets you build standards-based e-mail clients that employ various Internet mail protocols, including SMTP, POP, IMAP, and MIME, as well as related protocols such as NNTP, S/MIME, and others. The API divides naturally into two parts. The first focuses on sending, receiving, and managing messages independent of the protocol used, whereas the second focuses on specific use of the protocols. The purpose of this tutorial was to show how to use the first part of the API, without attempting to deal with protocol providers. The core JavaMail API consists of seven classes --Session, Message, Address, Authenticator, Transport, Store, and Folder --all of which are found in javax.mail, the top-level package for the JavaMail API. We used these classes to work through a number of common e-mail-related tasks, including sending messages, retrieving messages, deleting messages, authenticating, replying to messages, forwarding messages, managing attachments, processing HTML-based messages, and searching or filtering mail lists. Finally, we provided a number of step-by-step exercises to help illustrate the concepts presented. Hopefully, this will help you add e-mail functionality to your platform-independent Java applications. Resources You can do much more with the JavaMail API than what's found here. The lessons and exercises found here can be supplemented by the following resources: * Download the JavaMail 1.2 API from the JavaMail API home page . * The JavaBeans Activation Framework is required for versions 1.2 and 1.1.3 of the JavaMail API. * The JavaMail-interest mailing list is a Sun-hosted discussion forum for developers. * Sun's JavaMail FAQ addresses the use of JavaMail in applets and servlets, as well as prototol-specific questions. * Tutorial author John Zukowski maintains jGuru's JavaMail FAQ . * Want to see how others are using JavaMail? Check out Sun's list of third-party products. * If you want more detail about JavaMail, read Rick Grehan's "How JavaMail keeps it simple" (Lotus Developer Network, June 2000). * Benoit Marchal shows how to use Java and XML to produce plain text and HTML newsletters in this two-part series, "Managing e-zines with JavaMail and XSLT" Part 1 (developerWorks, March 2001) and Part 2 (developerWorks, April 2001). * "Linking Applications with E-mail" (Lotus Developer Network, May 2000) discusses how groupware can facilitate communication, collaboration, and coordination among applications. Fundamentals of the JavaMail API Page 32 Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Feedback Please let us know whether this tutorial was helpful to you and how we could make it better. We'd also like to hear about other tutorial topics you'd like to see covered. Thanks! For questions about the content of this tutorial, contact the author John Zukowski ( jaz@zukowski.net ) Colophon This tutorial was written entirely in XML, using the developerWorks Toot-O-Matic tutorial generator. The Toot-O-Matic tool is a short Java program that uses XSLT stylesheets to convert the XML source into a number of HTML pages, a zip file, JPEG heading graphics, and PDF files. Our ability to generate multiple text and binary formats from a single source file illustrates the power and flexibility of XML. Fundamentals of the JavaMail API Page 33
ICS - Internet Component Suite - V8 - Delphi 7 to RAD Studio 10 Seattle ======================================================================= (Aka FPIETTE's Components) Revised: March 3, 2016 http://www.overbyte.be/ http://wiki.overbyte.be/ Table of content: ----------------- - Legal issues - Donate - Register - Contributions - Latest Versions - Version Control repository - Installation - Available VCL Components - Sample applications - About SSL - Support - Release notes - Midware - Known problems - Special thanks Legal issues: ------------- Copyright (C) 1997-2016 by Fran鏾is PIETTE Rue de Grady 24, 4053 Embourg, Belgium SSL implementation includes code written by Arno Garrels, Berlin, Germany, contact: ICS is freeware. This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented, you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. 4. You must register this software by sending a picture postcard to the author. Use a nice stamp and mention your name, street address, EMail address and any comment you like to say. 5. As this code make use of OpenSSL, your rights are restricted by OpenSSL license as soon as you use any SSL feature. See http://www.openssl.org for details. Donate ------ ICS is freeware. You can use it without paying anything except the registration postcard (see "register" below). But of course donations are welcome. You can send cash (Euro currency or US Dollars) in an envelop to my street address or buy a gift certificate at Amazon in the UK. I will then use it to buy books. Here is the direct URL at Amazon UK (nearest to my home, please don't use another): http://www.amazon.co.uk/exec/obidos/gc-email-order1/ref=g_gc_email/202-6198323-6681414 For more generous amount, contact me by email. Register -------- ICS is freeware. If you use the components, you must register by sending a picture postcard showing the area you live in and some beautiful stamps for my kids who are stamp collectors. Do not use an envelop, I collect USED postcards sent to me. Write on the postcard that it is your ICS registration. Address your card to: Francois PIETTE, rue de Grady 24, 4053 Embourg, Belgium. Don't forget to mention your name, street address, EMail and web site. Contributions: -------------- ICS has been designed by Fran鏾is PIETTE but many other peoples are working on the components and sample programs. The history of changes in each source file list all developers having contributed (When no name is given, the change is by F. Piette). I can't list all contributors here but I want to specially thanks two specially active contributors: - Arno Garrels - Angus Robertson Latest versions: --------------- The latest versions of ICS can be downloaded from the ICS Wiki web site: http://wiki.overbyte.be/wiki/index.php/ICS_Download ICS V5 and V6 are archive releases no longer updated, last supported release was 2007. ICS V7 is a stable release that may still be updated for major bugs, but not for new releases of Delphi, latest it supported was XE3. ICS V8 is the current development release which is held in a public Version Control repository that is zipped each night for easy download. The download page above also includes the OpenSSL binaries needed to support SSL. ICS V8 supports Delphi 64-bit and Mac OS-X projects. Note that latest C++ Builder version supported is XE3 (lack of spare time, sorry). ICS V9 is in early development and is planned to support Android. There are no current plans for ICS for iOS. Version Control repository: --------------------------- svn://svn.overbyte.be/ics or http://svn.overbyte.be:8443/svn/ics (Usercode = ics, password = ics) Installation: ------------- ICS V8 has been designed for Embarcadero Delphi 2009 and up, and C++ Builder 2009 and up, but is fully compatible with Borland Delphi 7 and CodeGear 2006 and 2007. Embarcadero RAD Studio includes Delphi and C++ Builder. http://www.embarcadero.com/ With Delphi XE2 and later, VCL 64-bit Windows targets are supported for Delphi only. Currently FireMonkey is partly supported for Delphi only (there are still a few non-ported components). ICS for Mac OSX is currently experimental. The zip file has sub-directories in it. You must use the WinZip "Use folder names" option to restore this directory tree or you will have problems because the files would not be in their proper subdirectories. Please note most of these directories are differently named to ICS V7 and earlier, to ease support of multiple versions of Delphi and platforms, and to ease location of similar sample projects. Please don't install V8 over an existing V7 installation, it will be a mess of old and new. This is the new V8 sub-directory layout: .\ Info directory .\Install Component packages project groups for all versions .\Packages (was Delphi\Vc32) Delphi (7 and up) and C++Builder (2006 and up) packages projects .\Source (was Delphi\Vc32) ICS Delphi source code built into packages .\Source\Include (was Delphi\Vc32) .inc files (including OverbyteIcsDefs.inc) .\Source\Extras (was Delphi\Vc32) Extra source code not built into packages .\Source\zobj125 (was Delphi\Vc32) ZLIB C OBJ include files .\Lib Unit output directories for all package builds, subdirectories | for 2007+ will be created on building the packages \$(Config) Release / Debug | \$(Platform) Win32 / Win64 / OSX32 | \ D7..XE8, 10 Seattle includes .dcu and .dfm files for Delphi and .obj and .hpp files for C++ Builder .\Samples Delphi Win32/Win64 common source for all demos .\Samples\delphi\BroswerDemo Delphi Win32/Win64 Web Browser sample application (all Delphi versions) .\Samples\delphi\BroswerDemo\Resources Resource file, web pages and movie linked into browser demo .\Samples\delphi\FtpDemos Delphi Win32/Win64 FTP sample applications (all Delphi versions) .\Samples\delphi\MailNewsDemos Delphi Win32/Win64 SMTP, POP3, NNTP sample applications (all Delphi versions) .\Samples\delphi\MiscDemos Delphi Win32/Win64 Miscellaneous applications (all Delphi versions) .\Samples\delphi\OtherDemos Delphi Win32/Win64 DNS, Ping, SNMP, Syslog sample applications (all Delphi versions) .\Samples\delphi\PlatformDemos Delphi FireMonkey and cross-platform samples (Delphi XE2+) .\Samples\delphi\SocketDemos Delphi Win32/Win64 Socket sample applications (all Delphi versions) .\Samples\delphi\sslinternet Delphi Win32/Win64 SSL-enabled sample applications (all Delphi versions) .\Samples\delphi\WebDemos Delphi Win32/Win64 HTTP sample applications (all Delphi versions) .\Samples\delphi\WebDemos\WebAppServerData Directory for WebAppServ demo data files .\Samples\delphi\WebDemos\WebServData Directory for WebServ demo data files .\Samples\cpp\internet C++Builder sample applications .\Samples\cpp\internet\cb2006 C++Builder 2006 projects .\Samples\cpp\internet\cb2007 C++Builder 2007 projects .\Samples\cpp\internet\cb2009 C++Builder 2009 projects .\Samples\cpp\internet\cb2010 C++Builder 2010 projects .\Samples\cpp\internet\cbXE C++Builder XE projects .\Samples\cpp\internet\cbXE2 C++Builder XE2 projects UPGRADING and REINSTALLING Uninstall an existing ICS package (Menu | Component | Install Packages, select the component package and click Remove). Rename the old ICS directory and unzip to a new or empty directory, remove the old path from the library path and add either the new .\Source directory to the library path under Tools | Options |... or the appropriate .\Lib subdirectory according to version, ie .\Lib\Debug\Win32\D2007 for Delphi 2007. The latter has the advantage that the ICS source code won't be recompiled whenever your project is build. Also under Tools | Options |... add the new .\Source directory to the Browsing path. All DELPHI and C++ BUILDER VERSIONS/WIN32 Always upgrade your compiler with the latest update available from Embarcadero. Always update your system with http://windowsupdate.microsoft.com SSL or not SSL? By default the SSL code is compiled into the run-time package and additional SSL- enabled components are installed. In order to not compile the SSL code into the run-time package and to not install the SSL-Enabled components you need to remove the conditional define USE_SSL from both the run-time and design-time package. However if you do not build your applications with run-time packages it is recommended to build the packages with default settings. The SSL code will the be compiled into your applications depending on whether the conditional define USE_SSL is set in the project options or not (this requires having the .\Source directory in either in the library path or in projects Search path). Actual use of SSL in your applications also requires the OpenSSL files LIBEAY32.DLL and SSLEAY32.DLL being available somewhere in the path. Note different DLLs are needed for Win32 and Win64 applications. The ICS distribution includes the latest Win32 OpenSSL files in the .\OpenSSL-Win32 directory and the two main DLLs duplicated in .\Samples\delphi\sslinternet. Other OpenSSL files, including older and Win64, may be downloaded from: http://wiki.overbyte.be/wiki/index.php/ICS_Download INSTALLATION USING THE INSTALL PROJECT GROUPS For each Delphi and C++ Builder version one project group is provided in directory .\Install: Delphi 7 : D7Install.bpg Delphi 2006 : D2006Install.bdsgroup Delphi 2007 : D2007Install.groupproj Delphi 2009 : D2009Install.groupproj Delphi 2010 : D2010Install.groupproj Delphi XE : DXeInstall.groupproj Delphi XE2 : DXe2Install.groupproj // VCL only, no FireMonkey components Delphi XE2 : DXe2InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE3 : DXe3Install.groupproj // VCL only, no FireMonkey components Delphi XE3 : DXe3InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE4 : DXe4Install.groupproj // VCL only, no FireMonkey components Delphi XE4 : DXe4InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE5 : DXe5Install.groupproj // VCL only, no FireMonkey components Delphi XE5 : DXe5InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE6 : DXe6Install.groupproj // VCL only, no FireMonkey components Delphi XE6 : DXe6InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE7 : DXe7Install.groupproj // VCL only, no FireMonkey components Delphi XE7 : DXe7InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi XE8 : DXe8Install.groupproj // VCL only, no FireMonkey components Delphi XE8 : DXe8InstallVclFmx.groupproj // Both VCL and FireMonkey components Delphi 10 Seattle : D10SInstall.groupproj // VCL only, no FireMonkey components Delphi 10 Seattle : D10SInstallVclFmx.groupproj // Both VCL and FireMonkey components C++ Builder 2006 : CB2006Install.bdsgroup C++ Builder 2007 : CB2007Install.groupproj C++ Builder 2009 : CB2009Install.groupproj C++ Builder 2010 : CB2010Install.groupproj C++ Builder XE : CBXeInstall.groupproj C++ Builder XE2 : CBXe2Install.groupproj // VCL only no FireMonkey components C++ Builder XE2 : CBXe2InstallVclFmx.groupproj // Both VCL and FireMonkey components C++ Builder XE3 : CBXe3InstallVclFmx.groupproj // Both VCL and FireMonkey components 1 - Do a File/Open Project, navigate to the Install directory, select the correct file and open it. The project manager view should now display two package projects, one run-time and one design-time package. The run-time package name contains the "Run" suffix. The design-time package name contains the "Design" suffix. 2 - Select and Build the run-time package (do not install). 3 - Select and Install the design-time package. After a few seconds, you should have a dialog box telling you the package has been installed with a bunch of new components registered in the Tool Palette under "Overbyte ICS" and "Overbyte ICS SSL". Then do a "Save All" and a "Close All". 4 - One package is installed, called 'Overbyte ICS Design-Time Package for Delphi xxx'. 5 - Various directories under .\Samples\delphi\ include samples that illustrate use of all the ICS components, see later. FIREMONKEY CROSS PLATFORM PACKAGES: 1 - For XE2 and later, DXe?Install (where ? is the version) installs VCL components only, while DXe?InstallVclFmx also installs FireMonkey cross platform components (three run time packages). In order to use this feature first uninstall the old design-time package. 2 = Build all three run-time packages for all available platforms (32-bit and 64-bit Windows and Mac OS X) in the order they are listed in project manager. 3 - Next build and install the three design-time packages in the order they are listed in project manager. 4 - Three packages are installed, called: 'Overbyte ICS Common Design-Time Package for Delphi xxx' 'Overbyte ICS FMX Design-Time Package for Delphi xxx' 'Overbyte ICS VCL Design-Time Package for Delphi xxx' Note that the new packaging is still beta/alpha, both package names and included units might change in a future beta drop. The old VCL packages are still there however they do no longer support FireMonkey and of course only one set of packages can be installed in the IDE at the same time, if you want both VCL and FMX install DXe2InstallVclFmx.groupproj only. Currently the XE2 package cache is buggy and should be disabled by adding the -nocache parameter. 5 - The .\Samples\delphi\PlatformDemos\ folder contains FireMonkey sample projects that may all be built with FireMonkey for Mac OS X (and Windows). ALTERNATE INSTALLATION USING THE PACKAGE PROJECT FILES: For each Delphi and C++ Builder version two package project files exist in the .\Packages directory. One run-time and one design-time package project file. The run-time file name contains the "Run" suffix. The design-time file name contains the "Design" suffix. PACKAGE PROJECT FILE NAMES - VCL: Delphi 7 : OverbyteIcsD7Run.dpk, OverbyteIcsD7Design.dpk Delphi 2006 : OverbyteIcsD2006Run.bdsproj, OverbyteIcsD2006Design.bdsproj Delphi 2007 : OverbyteIcsD2007Run.dproj, OverbyteIcsD2007Design.dproj Delphi 2009 : OverbyteIcsD2009Run.dproj, OverbyteIcsD2009Design.dproj Delphi 2010 : OverbyteIcsD2010Run.dproj, OverbyteIcsD2010Design.dproj Delphi XE : OverbyteIcsDXeRun.dproj, OverbyteIcsDXeDesign.dproj Delphi XE2 : OverbyteIcsDXe2Run.dproj, OverbyteIcsDXe2Design.dproj Delphi XE3 : OverbyteIcsDXe3Run.dproj, OverbyteIcsDXe3Design.dproj Delphi XE4 : OverbyteIcsDXe4Run.dproj, OverbyteIcsDXe4Design.dproj Delphi XE5 : OverbyteIcsDXe5Run.dproj, OverbyteIcsDXe5Design.dproj Delphi XE6 : OverbyteIcsDXe6Run.dproj, OverbyteIcsDXe6Design.dproj Delphi XE7 : OverbyteIcsDXe7Run.dproj, OverbyteIcsDXe7Design.dproj Delphi XE8 : OverbyteIcsDXe8Run.dproj, OverbyteIcsDXe8Design.dproj Delphi 10 Seattle : OverbyteIcsD10SRun.dproj, OverbyteIcsD10SDesign.dproj C++ Builder 2006 : OverbyteIcsCB2006Run.bdsproj, OverbyteIcsCB2006Design.bdsproj C++ Builder 2007 : OverbyteIcsCB2007Run.cbproj, OverbyteIcsCB2007Design.cbproj C++ Builder 2009 : OverbyteIcsCB2009Run.cbproj, OverbyteIcsCB2009Design.cbproj C++ Builder 2010 : OverbyteIcsCB2010Run.cbproj, OverbyteIcsCB2010Design.cbproj C++ Builder XE : OverbyteIcsCBXeRun.cbproj, OverbyteIcsCBXeDesign.cbproj C++ Builder XE2 : OverbyteIcsCBXe2Run.cbproj, OverbyteIcsCBXe2Design.cbproj C++ Builder XE3 : OverbyteIcsCBXe3Run.cbproj, OverbyteIcsCBXe3Design.cbproj PACKAGE PROJECT FILE NAMES - FireMonkey and VCL: Delphi XE2 FMX/VCL : IcsCommonDXe2Run.dproj, IcsCommonDXe2Design.dproj Delphi XE2 VCL : IcsVclDXe2Run.dproj, IcsVclDXe2Design.dproj Delphi XE2 FMX : IcsFmxDXe2Run.dproj, IcsFmxDXe2Design.dproj Delphi XE3 FMX/VCL : IcsCommonDXe3Run.dproj, IcsCommonDXe3Design.dproj Delphi XE3 VCL : IcsVclDXe3Run.dproj, IcsVclDXe3Design.dproj Delphi XE3 FMX : IcsFmxDXe3Run.dproj, IcsFmxDXe3Design.dproj Delphi XE4 FMX/VCL : IcsCommonDXe4Run.dproj, IcsCommonDXe4Design.dproj Delphi XE4 VCL : IcsVclDXe4Run.dproj, IcsVclDXe4Design.dproj Delphi XE4 FMX : IcsFmxDXe4Run.dproj, IcsFmxDXe4Design.dproj Delphi XE5 FMX/VCL : IcsCommonDXe5Run.dproj, IcsCommonDXe5Design.dproj Delphi XE5 VCL : IcsVclDXe5Run.dproj, IcsVclDXe5Design.dproj Delphi XE5 FMX : IcsFmxDXe5Run.dproj, IcsFmxDXe5Design.dproj Delphi XE6 FMX/VCL : IcsCommonDXe6Run.dproj, IcsCommonDXe6Design.dproj Delphi XE6 VCL : IcsVclDXe6Run.dproj, IcsVclDXe6Design.dproj Delphi XE6 FMX : IcsFmxDXe6Run.dproj, IcsFmxDXe6Design.dproj Delphi XE7 FMX/VCL : IcsCommonDXe7Run.dproj, IcsCommonDXe7Design.dproj Delphi XE7 VCL : IcsVclDXe7Run.dproj, IcsVclDXe7Design.dproj Delphi XE7 FMX : IcsFmxDXe7Run.dproj, IcsFmxDXe7Design.dproj Delphi XE8 FMX/VCL : IcsCommonDXe8Run.dproj, IcsCommonDXe8Design.dproj Delphi XE8 VCL : IcsVclDXe8Run.dproj, IcsVclDXe8Design.dproj Delphi XE8 FMX : IcsFmxDXe8Run.dproj, IcsFmxDXe8Design.dproj Delphi 10 Seattle FMX/VCL: IcsCommonD10SRun.dproj, IcsCommonD10SDesign.dproj Delphi 10 Seattle VCL : IcsVclD10SRun.dproj, IcsVclD10SDesign.dproj Delphi 10 Seattle FMX : IcsFmxD10SRun.dproj, IcsFmxD10SDesign.dproj C++ Builder XE2 FMX/VCL : IcsCommonCBXe2Run.dproj, IcsCommonDXe2Design.dproj C++ Builder XE2 VCL : IcsVclCBXe2Run.dproj, IcsVclCBXe2Design.dproj C++ Builder XE2 FMX : IcsFmxCBXe2Run.dproj, IcsFmxCBXe2Design.dproj C++ Builder XE3 FMX/VCL : IcsCommonCBXe3Run.dproj, IcsCommonDXe3Design.dproj C++ Builder XE3 VCL : IcsVclCBXe3Run.dproj, IcsVclCBXe3Design.dproj C++ Builder XE3 FMX : IcsFmxCBXe3Run.dproj, IcsFmxCBXe3Design.dproj 1 - Open and Build the run-time package project (do not install!). 2 - Open and Install the design-time package project. (Do a File/Open Project, browse to the .\Packages directory. Select the correct file and open it. Then in the project manager view, right-click on the package, then click on either the Build or Install button.) 3 - For Delphi XE2 and later, a 64-bit run-time package can be built by changing the package target platform to 64-bit Windows. This has the same name as the 32-bit package, so a different package output directory needs to be specified in Tools / Options / Delphi Options for 64-bit Windows. After a few seconds, you should have a dialog box telling you the package has been installed with a bunch of new components registered in the Tool Palette under "Overbyte ICS" and "Overbyte ICS SSL". Then do a "Save All" and a "Close All". DELPHI 2006/WIN32, 2007/WIN32, 2009/WIN32, 2010/WIN32, XE/WIN32: Having installed the package, verify that the appropriate Win32 Library Path (Tools / Options / Delphi Options / Library - Win32 / Library Path) has been added, .\Lib subdirectory according to version, ie .\Lib\Debug\Win32\D2007 for Delphi 2007. If not, add it manually. It is not mandatory to add .\Lib to the global Delphi path, but it will be much easier for you because otherwise you'll have to add it to each project. DELPHI XE2/WIN32, XE3/WIN32, XE4/WIN32, XE5/WIN32, XE6/WIN32, XE7/WIN32, XE8/WIN32, 10 Seattle/WIN32, XE2/WIN64, XE3/WIN64, XE4/WIN64, XE5/WIN64, XE6/WIN64, XE7/WIN64, XE8/WIN64, 10 Seattle/WIN64: Similar to above, but the Library path is specified separately for 32-bit and 64-bit Windows Platforms. DELPHI 7: Add VC32 directory path to your library path (Tools menu / Environment Options / Library / Library Path. Add .\Lib\Debug\Win32\D7 path at the end of the existing path). SAMPLE DELPHI PROJECTS Once the package is installed, you may open the sample projects. The samples are split into several directories according to protocols, most with a project group that can be opened in all versions of Delphi. .\Samples\delphi\BroswerDemo .\Samples\delphi\FtpDemos\FtpDemos.bpg .\Samples\delphi\MailNewsDemos\MailNewsDemos.bpg .\Samples\delphi\MiscDemos\MiscDemos.bpg .\Samples\delphi\OtherDemos\OtherDemos.bpg .\Samples\delphi\PlatformDemos\XSamples.groupproj .\Samples\delphi\SocketDemos\SocketDemos.bpg .\Samples\delphi\sslinternet\SslDemos.bpg .\Samples\delphi\WebDemos\WebDemos.bpg Full details of the sample projects are shown later in this document. You might get some dialog box telling you that resource files are missing (they may not have been included in the zip file to save space) and are recreated by Delphi. It is OK. Any other error message is a problem you should fix. After all resource files have been recreated, you should see in the project manager a group of projects. To compile all samples in the group at once, do Project / Build all projects. This may take a few minutes. Note 1: Delphi may run out of memory if you ask to compile all projects at once. If you have not enough RAM, then compile each project individually. Note 2: Delphi has warnings which triggers a lot of messages for 100% OK code. You can turn those warnings off in the project/ options / Compiler messages and deselecting: "Deprecated symbol", "Platform symbol", "unsafe type", "unsafe code", "unsafe typecast". Those are intended for .NET and Linux portability. You can safely ignore them if you run windows. For you facility, I included a utility SetProjectOptions (source code, you must compile it) in the internet directory. This utility will update project options to disable the warnings. Once the components are all installed, you may open the sample projects each one after the other and compile them. For each project, do file/open and select the dpr file in the internet directory. Then Project/Build All. C++ BUILDER 2006, 2007, 2009, 2010, XE, XE2, XE3: Follow the installation procedure described for Delphi 2006. Just change the project group and package name: use CB2006, CBXe, etc, see above. You can't have Delphi 2006 and CBuilder 2006 packages installed at the same time in the IDE. So when switching from one to the other, be sure to remove the one you don't need. Building the FireMonkey CBXE2InstallVclFmx C++ packages for OSX may trigger an ILINK32 error, this is a bug in C++ Builder reported as QC #103668 the Win32 packages should build without errors. Once the components are all installed, you may open the sample projects each one after the other and compile them. For each project, do file/open and select the dpr file in the internet directory. Then Project/Build All. Projects are located in SAMPLES\CPP\INTERNET\CB2006\ (or CB2006, CBXE, etc) with a project group in each directory, OverbyteIcsCB2006Sam.bdsgroup, OverbyteIcsCBXe2Sam.groupproj, etc. It is likely that for each project, C++ Builder complains about a missing .res file. This is not a problem, C++ Builder will recreate it as needed. They have not been included to save space in the zip file. Once the components are all installed, you may open the sample projects each one after the other and compile them. For each project, do file/open and select the dpr file in the internet directory. Then Project/Build All. NOTES: - You may have an error message, using Delphi or C++ Builder complaining about Font.Charset, OldCreateOrder and other properties. Those are new properties in newer Delphi or C++ Builder versions, newer than the version you use. You can safely ignore those errors because those properties are not used by the components nor sample programs. You may encounter this error at run time. To avoid it, you must open each form at design time and ignore the error. Then recompile. If you don't ignore the error at design time, you'll have it at runtime ! - If you have Delphi or C++ Builder complaining about a file not found, add .\source directory to your library path. - If you are using C++ Builder you may encounter an error at link time such as "Unable to open file MWBCB30.LIB" (or other libs). This is a bug in C++ Builder. To solve it, you can edit project option file (right click in project manager) and remove any reference to the missing libraries. - Don't forget that the C++Builder components are located in .\delphi\vc32 which is object pascal source code (not a problem for C++Builder, just indicate that the *.pas files are displayed when installing). C++Builder will create the *.hpp files. There are some on-line help files in the VC32 directory. Available VCL Components ------------------------ - The following is a list of the files that should be installed in order to properly add all of the available components in this collection: > OverbyteIcsCharsetComboBox.pas Provides easy MIME charset selection > OverbyteIcsDnsQuery DNS lookup component - useful for getting MX records > OverbyteIcsDprUpdFix.pas IDE plugin for Delphi 2009 and 2010 to update old projects > OverbyteIcsEmulVT.pas ANSI terminal emulation in a control > OverbyteIcsFingCli.pas FINGER client protocol - Find information about user > OverbyteIcsFtpCli.pas FTP client protocol - file transfer > OverbyteIcsFtpSrv.pas FTP server protocol - file transfer > OverbyteIcsFtpSrvT.pas FTP server protocol - helpers > OverbyteIcsHttpAppServer.pas HTTP server protocol - used to build advanced web servers > OverbyteIcsHttpProt.pas HTTP client protocol - used by the web > OverbyteIcsHttpSrv.pas HTTP server protocol - used to build web servers > OverbyteIcsLogger.pas A component to log information > OverbyteIcsMimeDec.pas MIME component - decode file attach, use with POP3 > OverbyteIcsMultiProgressBar.pas A segmented progress bar > OverbyteIcsMultipartFtpDownloader.pas FTP client protocol - download one file using simultaneous connections to speedup download > OverbyteIcsMultipartHttpDownloader.pas HTTP client protocol - download one file using simultaneous connections to speedup download > OverbyteIcsNntpCli.pas NNTP client protocol - send and receive newsgroups messages > OverbyteIcsPing.pas ICMP echo protocol - ping a host > OverbyteIcsPop3Prot.pas POP3 client protocol - get mail from mail server > OverbyteIcsReg.pas Register design components > OverbyteIcsSmtpProt.pas SMTP client protocol - send mail to server > OverbyteIcsSmtpSrv.pas SMTP server protocol - receive mail from client > OverbyteIcsSnmpCli.pas SNMP client protocol - network management > OverbyteIcsSnmpMsgs.pas SNMP client protocol - message helper > OverbyteIcsSysLogClient.pas Syslog Client Protocol - receive syslog messages > OverbyteIcsSysLogDefs.pas Syslog Protocol - helpers > OverbyteIcsSysLogServer.pas Syslog Server Protocol - send syslog messages > OverbyteIcsTnCnx.pas TELNET client protocol - terminal emulation protocol > OverbyteIcsTnEmulVT.pas TELNET and ANSI terminal emulation combined > OverbyteIcsTnOptFrm.pas TELNET Client configuration form > OverbyteIcsTnScript.pas TELNET client protocol - with automation > OverbyteIcsWSocket.pas Winsock component - TCP, UDP, DNS,... > OverbyteIcsWSocketE.pas Register procedure and property editor for TWSocket > OverbyteIcsWSocketS.pas Winsock component for building servers > OverbyteIcsWSocketTS.pas Winsock component for building multithreaded servers - The following list support and utilities units: > OverbyteIcsAsn1Utils.pas ASN1 utilities (for TSnmpClient component) > OverbyteIcsAvlTrees.pas Implements a fast cache-like data storage > OverbyteIcsCharsetUtils.pas MIME-charset functions > OverbyteIcsCookies.pas Client Cookie Handling > OverbyteIcsCRC.pas 32 bit CRC computation > OverbyteIcsCsc.pas character set routines > OverbyteIcsDES.pas Implementation of the Data Encryption Standard (DES) > OverbyteIcsDigestAuth.pas HTTP Digest Access Authentication > OverbyteIcsFormDataDecoder.pas Decode a MIME data block as generated by a HTML form > OverbyteIcsHttpCCodZLib.pas Supports GZIP coding for HttpContCod > OverbyteIcsHttpContCod.pas HTTP Content Coding support, uses extra units > OverbyteIcsIcmp.pas ICMP protocol support, used by the PING component > OverbyteIcsIconv.pas Headers for iconv library (LGPL) > OverbyteIcsLIBEAY.pas Delphi encapsulation for LIBEAY32.DLL (OpenSSL) > OverbyteIcsMD4.pas Implementation of the MD4 Message-Digest Algorithm > OverbyteIcsMD5.pas Implementation of the MD5 Message-Digest Algorithm > OverbyteIcsMimeUtil.pas Support routines for MIME standard > OverbyteIcsMLang.pas A few header translations from MS mlang.h > OverbyteIcsNtlmMsgs.pas Client NTLM authentification messages used within HTTP protocol > OverbyteIcsNtlmSsp.pas Server NTLM authentification of user credentials using Windows SSPI > OverbyteIcsOneTimePw.pas One Time Password support functions, used by FTP > OverbyteIcsSHA1.pas Implementation of US Secure Hash Algorithm 1 (SHA1) > OverbyteIcsSocketUtils.pas Cross platform socket utilities for ICS > OverbyteIcsSSLEAY.pas Delphi encapsulation for SSLEAY32.DLL (OpenSSL) > OverbyteIcsSslSessionCache.pas A very fast external SSL-session-cache component > OverbyteIcsSslThrdLock.pas Implementation of OpenSsl thread locking (Windows); > OverbyteIcsSspi.pas A few header translations from MS sspi.h and security.h > OverbyteIcsStreams.pas Fast streams for ICS > OverbyteIcsThreadTimer.pas A custom timer class using custom timer messages from one or more threads > OverbyteIcsTicks64.pas GetTickCount64 support for all versions of Windows > OverbyteIcsTimeList.pas List of items with expiry times, used for WebSessions > OverbyteIcsTypes.pas Common types, mainly for backward compiler compatibility > OverbyteIcsURL.pas Support routines for URL handling > OverbyteIcsUtils.pas Vast number of common utilities, many supporting Unicode for D7/2007 > OverbyteIcsWSockBuf.pas FIFO buffers for TWSocket > OverbyteIcsWebSession.pas Web session support for THttpAppSrv and MidWare > OverbyteIcsWinnls.pas A few header translations for Unicode Normalization in winnls.h > OverbyteIcsWinsock.pas Some Winsock initialisations > OverbyteIcsWndControl.pas A class that encapsulates a windows message queue and a message map > OverbyteIcsZLibDll.pas Zlib support, interface to external zlib.dll functions > OverbyteIcsZlibHigh.pas Zlib support, high level interface for compression and decompression > OverbyteIcsZLibObj.pas Zlib support, interface to zlib linked C OBJ functions FireMonkey Cross Platform Support: ---------------------------------- For Delphi and C++ Builder XE2 and later, FireMonkey Desktop applications are an alternate to VCL Forms applications, supporting cross platforms of Windows 32-bit and 64-bit and Mac OS X (and perhaps other platforms in future). FireMonkey uses different visual components to VCL, while some non-visual components can be used for both VCL and FMX projects, while other components need special versions, such as ICS. Earlier betas of V8 used the conditional define "FMX" which is *no longer required in project options. Instead in your existing ICS FireMonkey app. add either "Ics.Fmx" to the unit scope names in project options or apply the following changes in the uses clause, rename: OverbyteIcsWndControl -> Ics.Fmx.OverbyteIcsWndControl OverbyteIcsWSocket -> Ics.Fmx.OverbyteIcsWSocket OverbyteIcsFtpCli -> Ics.Fmx.OverbyteIcsFtpCli OverbyteIcsFtpSrv -> Ics.Fmx.OverbyteIcsFtpSrv OverbyteIcsHttpProt -> Ics.Fmx.OverbyteIcsHttpProt OverbyteIcsWSocketS -> Ics.Fmx.OverbyteIcsWSocketS OverbyteIcsSmtpProt -> Ics.Fmx.OverbyteIcsSmtpProt.pas OverbyteIcsPop3Prot -> Ics.Fmx.OverbyteIcsPop3Prot.pas OverbyteIcsNntpCli -> Ics.Fmx.OverbyteIcsNntpCli.pas OverbyteIcsPing -> Ics.Fmx.OverbyteIcsPing.pas OverbyteIcsDnsQuery -> Ics.Fmx.OverbyteIcsDnsQuery.pas OverbyteIcsFingCli -> Ics.Fmx.OverbyteIcsFingCli.pas OverbyteIcsSslSessionCache -> Ics.Fmx.OverbyteIcsSslSessionCache.pas OverbyteIcsSslThrdLock -> Ics.Fmx.OverbyteIcsSslThrdLock.pas OverbyteIcsHttpSrv -> Ics.Fmx.OverbyteIcsHttpSrv.pas OverbyteIcsSocketUtils -> Ics.Fmx.OverbyteIcsSocketUtils.pas OverbyteIcsMultipartFtpDownloader -> Ics.Fmx.OverbyteIcsMultipartFtpDownloader.pas OverbyteIcsMultipartHttpDownloader -> Ics.Fmx.OverbyteIcsMultipartHttpDownloader.pas OverbyteIcsHttpAppServer -> Ics.Fmx.OverbyteIcsHttpAppServer.pas OverbyteIcsThreadTimer -> Ics.Fmx.OverbyteIcsThreadTimer.pas OverbyteIcsCharsetComboBox -> Ics.Fmx.OverbyteIcsCharsetComboBox.pas { Demo units } OverbyteIcsWebAppServerCounter -> Ics.Fmx.OverbyteIcsWebAppServerCounter OverbyteIcsWebAppServerMailer -> Ics.Fmx.OverbyteIcsWebAppServerMailer The list above is also the list of units that now have different names in the FireMonkey framework however most of them share the same source file. Dropping a ICS component on the form will add the correct unit name for each framework automatically (don't forget to disable the package cache as described above). Unit OverbyteIcsLibrary.pas has been *deprecated* and ICS IPv8 doesn't use it anymore. If you used it in your own code read the comment in OverbyteIcsLibrary.pas, search for "deprecated". Sample applications: -------------------- With V8, the sample applications are now grouped into directories according to general functionality, to make it easier to compare related samples. Many samples are similar. When searching for something, always look at the date the demos where created. The most recent is always the best code! In the lists below, ACTIVE!! indicates applications that are actively maintained to test and support new functionality in the ICS components. These may not be simplest samples, but are usually the first to try when learning about a component. Delphi Win32/Win64 Web Browser sample application ------------------------------------------------- .\Samples\delphi\BroswerDemo > FrameBrowserIcs.dpr Web Browser using HtmlViewer component - ACTIVE!! Note this sample needs HtmlViewer component installed Delphi Win32/Win64 FTP sample applications ------------------------------------------ .\Samples\delphi\FtpDemos\FtpDemos.bpg - Project group > OverbyteIcsBasFtp.dpr Basic FTP client program > OverbyteIcsConFtp.dpr Basic console mode FTP client > OverbyteIcsFtpAsy.dpr Example of asynchronous FTP client > OverbyteIcsFtpMulti.dpr Demo to do several FTP downloads in parallel to get a list of files > OverbyteIcsFtpMultipartDownload.dpr Demo to FTP download a single large file in several parts in parallel > OverbyteIcsFtpServ.dpr General purpose FTP server, uses TSocketServer - ACTIVE!! > OverbyteIcsFtpThrd.dpr Demo of multithreaded FTP client, see also FTPASY > OverbyteIcsFtpTst.dpr Basic graphical FTP client - ACTIVE!! Delphi Win32/Win64 SMTP, POP3, NNTP sample applications ------------------------------------------------------- .\Samples\delphi\MailNewsDemos\MailNewsDemos.bpg - Project group > OverbyteIcsBasNntp.dpr Basic NNTP client program > OverbyteIcsConPop3.dpr Basic console mode demo for POP3 (mail receive) > OverbyteIcsConSmtp.dpr Basic console mode demo for SMTP (mail send) > OverbyteIcsMailHtml.dpr Example of HTML formatted EMail sending, including embedded images - ACTIVE!! > OverbyteIcsMailRcv.dpr Internet EMail access using POP3 protocol - ACTIVE!! > OverbyteIcsMailSnd.dpr Example of EMail sending using SMTP, including file attach - ACTIVE!! > OverbyteIcsMailSndAsync.dpr Example of parallel EMail sending with multiple connections > OverbyteIcsMimeDemo.dpr Example of EMail decoding (attached files are extracted) - ACTIVE!! > OverbyteIcsNewsReader.dpr Example of TNntpCli component (Send/receive newsgroups) - ACTIVE!! > OverbyteIcsSmtpServer.dpr Internet EMail server using SMTP protocol - ACTIVE!! Delphi Win32/Win64 Miscellaneous applications --------------------------------------------- .\Samples\delphi\MiscDemos\MiscDemos.bpg - Project group > OverbyteIcsBufStrmTst.dpr Test of buffered stream classes > OverbyteIcsCacheTest.dpr Test of TCacheTree class used in TSslAvlSessionCache > OverbyteIcsMD4Test.dpr Test program for MD4 unit > OverbyteIcsMD5File.dpr Example of MD5 unit: computer MD5 checksum for files > OverbyteIcsMD5Test.dpr Test program for MD5 unit > OverbyteIcsOneTimePassword.dpr One Time Password test routines for OverByteIcsOneTimePw unit > OverbyteIcsSHA1Test.dpr Test program for SHA unit > OverbyteIcsThreadTimerDemo.dpr Demo for TIcsThreadTimer > OverbyteIcsTicks64Demo.dpr GetTickCount64 test routines for OverbyteIcsTicks64 unit > OverbyteIcsTimerDemo.dpr Very simple demo for TIcsTimer > OverByteIcsWndControlTest.dpr Test program for windows and threads Delphi Win32/Win64 DNS, Ping, SNMP, Syslog sample applications -------------------------------------------------------------- .\Samples\delphi\OtherDemos\OtherDemos.bpg - Project group > OverbyteIcsBatchDnsLookup.dpr Batch async DNS lookup using DnsLookup (IPv6 and IPv4) > OverbyteIcsConPing.dpr Basic console mode demo for ping component > OverbyteIcsDll1.dpr Demo showing how to use a TWSocket component in a DLL > OverbyteIcsDll2.dpr Demo showing how to use a THttpCli component in a DLL > OverbyteIcsDllTst.dpr Test program calling ICSDLL1 and ICSDLL2 > OverbyteIcsDnsLook.dpr Example of name resolution (IPv6 and IPv4) > OverbyteIcsDnsResolver.dpr Batch async DNS lookup event driven using DnsQuery > OverbyteIcsFinger.dpr Example of TFingerCli component > OverbyteIcsNsLookup.dpr Demo for the DnsQuery component > OverbyteIcsPingTst.dpr Demo for the ping component, includes trace route > OverbyteIcsSnmpCliTst.dpr Demo for SNMP (simple network management protocol) component > OverbyteIcsSysLogClientDemo.dpr Demo for SysLog client component > OverbyteIcsSysLogServerDemo.dpr Demo for SysLog server component Delphi FireMonkey cross-platform samples (Delphi XE2 and later) --------------------------------------------------------------- All these samples may be built for Mac OS X (and Windows). .\Samples\delphi\PlatformDemos\XSamples.groupproj > IcsCliDemo.dproj Example of client for SRVDEMO, IPV4 only > IcsTcpSrvIPv6.dproj Basic server without client forms, event-driven, IPv4/IPV6 > IcsConSmtp.dproj Basic console mode demo for SMTP (mail send) > IcsMailSnd.dproj Example of EMail sending using SMTP, including file attach > IcsMailRcv.dproj Internet EMail access using POP3 protocol > IcsHttpsTst.dproj Example of THttpCli component (GET), show many features > IcsWebServ.dproj Demo of HTTP server, uses TSocketServer > IcsWebAppServ.dproj Advanced HTTP server demo, uses WebServ, adds sessions > IcsFtpTst.dproj Basic graphical FTP client > IcsFtpServ.dproj General purpose FTP server, uses TSocketServer > IcsUdpLstn.dproj UDP listen demo > IcsUdpSend.dproj UDP send demo > IcsBatchDnsLookup.dproj Batch async DNS lookup using DnsLookup (IPv6 and IPv4) > IcsDll1.dproj Demo showing how to use a TWSocket component in a DLL > IcsDll2.dproj Demo showing how to use a THttpCli component in a DLL > IcsDllTst.dproj Test program calling ICSDLL1 and ICSDLL2 > IcsThreadTimerDemo.dproj Very simple demo for TIcsTimer Delphi Win32/Win64 Socket sample applications --------------------------------------------- .\Samples\delphi\SocketDemos\SocketDemos.bpg - Project group > OverbyteIcsBinCliDemo.dpr Client program to receive binary and delimited text data. Works with BinTcpSrv demo. > OverbyteIcsCliDemo.dpr Example of client for SRVDEMO, IPV4 only - ACTIVE!! > OverbyteIcsClient5.dpr Basic client GUI applications > OverbyteIcsClient7.dpr Simple client application demonstrating TWSocket > OverbyteIcsConCli1.dpr Basic client/server console applications > OverbyteIcsConCli2.dpr Basic client/server console applications with thread > OverbyteIcsConSrv1.dpr Basic server application in console mode > OverbyteIcsConUdpLstn.dpr Console application to listen for UDP messages > OverbyteIcsDynCli.dpr Demo of dynamically created TWSocket components > OverbyteIcsMtSrv.dpr Basic server, multi-threaded, see THRDSRV for better code > OverbyteIcsRecv.dpr Simple file receive (server), use with SENDER demo (client) > OverbyteIcsSender.dpr Simple file send (client), use with RECV demo (server) > OverbyteIcsServer5.dpr Basic server GUI applications > OverbyteIcsSocksTst.dpr How to use TWSocket with SOCKS protocol (firewall traversing) > OverbyteIcsSrvDemo.dpr Example of server using a TTable - ACTIVE!! > OverbyteIcsSrvTcp.dpr Basic server without client forms, event-driven > OverbyteIcsSvcTcp.dpr Same as SRVTCP but as an NT/2K/XP service > OverbyteIcsTWSChat.dpr Chat program (both client and server in a single program) > OverbyteIcsTcpSrv.dpr Basic server without client forms, event-driven, IPv4 only - ACTIVE!! > OverbyteIcsTcpSrvIPv6.dpr Basic server without client forms, event-driven, IPv4/IPV6 - ACTIVE!! > OverbyteIcsTelnetClient.dpr Telnet client using a TnEmulVT > OverbyteIcsThrdSrv.dpr Basic multithreaded TCP server, banner sent in main thread > OverbyteIcsThrdSrvV2.dpr Basic multithreaded TCP server, banner sent in worker thread > OverbyteIcsThrdSrvV3.dpr Basic TCP server showing how to use TWSocketThrdServer > OverbyteIcsTnDemo.dpr Telnet client using a TMemo > OverbyteIcsTnSrv.dpr Basic TCP server with client forms, event-driven > OverbyteIcsUdpLstn.dpr UDP listen demo > OverbyteIcsUdpSend.dpr UDP send demo Delphi Win32/Win64 SSL-enabled sample applications -------------------------------------------------- .\Samples\delphi\sslinternet\SslDemos.bpg - Project group > OverbyteIcsHttpsTst.dpr Example of TSslHttpCli component (GET) - ACTIVE!! > OverbyteIcsPemTool.dpr ICS Pem Certificate Tool - Create and import certificates in OpenSLL PEM format > OverbyteIcsSimpleSslCli.dpr Example of simple SSL client using TSslWSocket - ACTIVE!! > OverbyteIcsSimpleSslServer.dpr Example of SSL server using TSslWSocket - ACTIVE!! > OverbyteIcsSslFtpServ.dpr General purpose FTP SSL server, uses TSocketServer - ACTIVE!! > OverbyteIcsSslFtpTst.dpr Basic graphical FTP SSL client - ACTIVE!! > OverbyteIcsSslMailRcv.dpr Internet EMail access using POP3 protocol and SSL - ACTIVE!! > OverbyteIcsSslMailSnd.dpr Example of EMail sending using SMTP and SSL - ACTIVE!! > OverbyteIcsSslNewsRdr.dpr Example of TSslNntpCli component (Send/receive newsgroups) - ACTIVE!! > OverbyteIcsMsVerify.dpr Verify and show an OpenSSL certificate or certificate chain using class TMsCertChainEngine which uses MS crypto API - ACTIVE!! > OverbyteIcsSslSniSrv.dpr Test of Server Name Indication (SNI) in server mode - ACTIVE!! > OverbyteIcsSslWebServ.dpr Demo of HTTPS server, uses TSocketServer - ACTIVE!! > OverbyteIcsSslWebAppServer.dpr Advanced HTTPS server demo, uses WebServ, adds sessions - ACTIVE!! > OverbyteIcsSslSmtpServer.dpr Internet EMail server using SMTP protocol and SSL - ACTIVE!! Delphi Win32/Win64 HTTP sample applications ------------------------------------------- .\Samples\delphi\WebDemos\WebDemos.bpg - Project group > OverbyteIcsConHttp.dpr Basic console mode HTTP client > OverbyteIcsHttpAsp.dpr Example of THttpCli component with cookie (POST to an ASP page) > OverbyteIcsHttpAsy.dpr Example of THttpCli component with multiple async requests (GET) > OverbyteIcsHttpChk.dpr Example of THttpCli to check for valid URL using HEAD request > OverbyteIcsHttpDmo.dpr Simple HTTP client demo with proxy > OverbyteIcsHttpGet.dpr Example of THttpCli component (GET into a file) > OverbyteIcsHttpMultipartDownload.dpr Demo application for TMultipartHttpDownloader to download files using simultaneous connections > OverbyteIcsHttpPg.dpr Example of THttpCli component (POST to CGI script) > OverbyteIcsHttpPost.dpr Example of THttpCli component (POST), work with WebServ sample - ACTIVE!! > OverbyteIcsHttpThrd.dpr Example of THttpCli component (multi-threaded GET) > OverbyteIcsHttpTst.dpr Example of THttpCli component (GET), show many features - ACTIVE!! > OverbyteIcsIsapi.dll Example of FTP client component within an ISAPI extension > OverbyteIcsWebAppServer.dpr Advanced HTTP server demo, uses WebServ, adds sessions - ACTIVE!! > OverbyteIcsWebServ.dpr Demo of HTTP server, uses TSocketServer - ACTIVE!! Two samples are not in the project group since they need extra components installed > OverbyteIcsRestDemo.drp Demo program showing how to use REST API from Google and Yahoo > OverbyteIcsRestJsonDemo.drp Demo program showing how to use REST API from Google Search and JSON Sample Notes ------------ Note 1: Not all samples have been rewritten in C++ for C++ Builder. And those rewritten are frequently much simpler. So C++ Builder user: have a look at the Delphi sample too ! Note 2: Follow "UserMade" link on ICS web site to find more sample programs written by ICS users. As explained in the component installation, you may encounter an error loading a sample application or running it. This may be because the last time I loaded the form, I was using another Delphi or C++ Builder version which has new properties. You can safely ignore messages related to those new properties. They are not used in the samples. (The properties are CharSet, OldCreateOrder and others). You can also encounter error about duplicate resources. You can ignore them safely. If you have those errors, open each form in the IDE, ignore the error then recompile. If you don't open the form in the IDE, you'll get the errors at runtime and your program will abort. When installing a new version, always delete old dcu, obj, dcpil and always recompile everything ! Close everything before recompiling the library or packages. When installing a new version, be sure to unzip it in the same directory tree as the old one or you'll mess both versions. About SSL: ---------- TSslWSocket and TSslWSocketServer component are derived from the standard TWSocket and TWSocketServer component. The SSL code is compiled into the component only if you define USE_SSL symbol to your packages and projects. Just add USE_SSL to the defines in the project or package options and recompile everything. The components make use of LIBEAY32.DLL and SSLEAY32.DLL to handle SSL protocol stuff. The DLLs are dynamically loaded at runtime. It means that the DLLs will only be required at runtime when you first make use of a SSL function. Your applications will run on systems without OpenSSL DLLs as long as you don't call any SSL function. The files may be downloaded from: http://wiki.overbyte.be/wiki/index.php/ICS_Download Most ICS components have their SSL enabled counter part. They work exactly the same way as the regular component except when SSL specific stuff is needed, for example certificates. To support SSL stuff, the SSL-enabled version use some new properties, events and methods. Many sample programs have their SSL-enabled counter part in a separate sources located in SslInternet folder. SSL certificates: To make use of SSL, you frequently need certificates. I provide some demo certificates I built using command line OpenSSL tool. PEM certificates can be opened by a text editor, LF as well as CRLF are allowed as line breaks. CACERT.PEM : A demo certificate for "Example CA" 01CERT.PEM : A demo certificate which is signed by CACERT.PEM 01KEY.PEM : A demo private key for 01CERT.PEM Passphrase is "password". CLIENT.PEM : A demo certificate and private key. Passphrase is "password". SERVER.PEM : A demo certificate and private key. Passphrase is "password". ROOT.PEM : A demo CA certificate. Passphrase is "password". TRUSTEDCABUNDLE.PEM : A demo CA file in PEM format containing multiple well known root CA certificates to be specified in property CA Path of the demo applications. Read the comments included in this file. 6F6359FC.0 : Located in sub directory SslInternet\TrustedCaStore, it's the file CACERT.PEM stored with a hashed file name. Directory TrustedCaStore can be specified in property CA Path of the demo applications. For details about certificate, see the excellent book: "Network security with OpenSSL", O'Reilly, ISBN 10: 0-596-00270-X The SSL demo project OverbyteIcsPemTool may be used to create self signed PEM certificates, certificate requests for commercial use, to convert existing certificates in the Windows Certificate Store to PEM format understood by OpenSSL and to examine PEM certificates. You will find more information in IcsSslHowTo.txt file. Commercial SSL certificates: To avoid browsers giving certificate warning messages, you need to purchase a SSL certificate from one of numerous companies, such as Verisign, Thawte GeoTrust or RapidSSL. Prices vary dramatically and are often cheaper from resellers such as Servertastic than from the main issuing companies. The main purpose of an SSL certificate is to prove the identity of the owner of a web site, ideally the company behind the web site. That usually requires paper work identifying the company is submitted and also proof the domain being protected is owned by that company, it usually also involves telephone calls. Such certificates are usually called fully validated and cost $120 or more each year for a single domain, ie secure.website.com. Wild card certificates cost $350 or more, but protect multiple sub-domains, ie web.website.com as well. Extended Validation certificates cost from $450 a year, and show the company name in green in the address bar. For testing and simple use, instant issued SSL certificates cost from $15 per year and protect a single domain only with automated checking reducing the cost (an email to admin@website.com to prove you receive email for the domain, perhaps a telephone call as well). Note these instant certificates do not include a company name. To buy and install an SSL certificate for use with ICS and OpenSSL follow these steps: 1 - Build the SSL demo project OverbyteIcsPemTool. Take Extras, Create Certificate Requests, fill in the various fields (check other certificates if uncertain, the Common Name is the domain to protect, ie secure.website.com and E-Mail should be an email address at the than domain, ideally admin or administrator, 2048 bits. Click Create, and specify two file names, first for the private key (mykey.pem) then the certificate request file (myreq.pem). The request can also be done using OpenSSL command line arguments, or you can build it into your own application. 2 - Choose you SSL supplier and certificate type, at some point during the ordering process you will be asked for the certificate request, so open the PEM file you saved with a text editor and copy the base64 encoded block starting -BEGIN CERTIFICATE REQUEST- into the web form. It should be decoded and displayed so you check it's correct. The private key is not needed for the certificate to be issued. At this point the validation process starts as mentioned above, which might take hours or weeks to complete. 3 - Eventually the SSL certificate should be issued, either by email or made available to download from the supplier's web site. It should be in X.509 format in a base64 encoded block starting -BEGIN CERTIFICATE- which should be saved as a PEM file (mycert.pem). There should also be an Intermediate CA certificate, with which your new certificate was signed, which should also be saved as a file (mycacert.pem). This may also be downloadable from the supplier as a bundle file and should be common to any certificates they issue, ie RapidSSL_CA_bundle.pem. 4 - The OverbyteIcsPemTool tool has a View PEM button that allows examination of your new PEM files. 5 - The three PEM files now need to be attached to the SslContext component in your application, with properties SslCertFile, SslPrivKeyFile and SslCAFile. The request certificate file has no further use. Support: -------- There is a mailing list to discuss F. Piette's components and applications. To subscribe surf to http://lists.elists.org/mailman/listinfo/twsocket. Do not use an aliased EMail address, use your real EMail address, the one you'll use to post messages. After asking for subscription, you'll receive a confirmation email you must reply to it or you will _not_ be added to the subscriber's list (this is to check for email path and also make sure someone doesn't subscribe you without your consent). Once you have been registered with the mailing list processor, you can send messages to twsocket@elists.org. Every subscriber will receive a copy of your message. I will respond, but anybody is welcome to respond to each other's messages. So every body can share his expertise. There are many other useful mailing lists at http://www.elists.org ! Before asking a question, browse the message archive you can download from the support page on the web site (click the "support" button from main page) and from the mailing list web site http://lists.elists.org/mailman/listinfo/twsocket. Google is also archiving the list with some delay. If you found a bug, please make a short program that reproduces the problem attach it to a message addressed to me. If I can reproduce the problem, I can find a fix ! Do not send exe file but just source code and instructions. Always use the latest version (beta if any) before reporting any bug. You are also encouraged to use the support mailing list to ask for enhancements. You are welcome to post your own code. The support mailing list has sometimes a heavy traffic. If it is too much for you, you can select "digest" mode in which mailing list processor will mail you only one big message per day. To select digest mode goto http://lists.elists.org/mailman/listinfo/twsocket. You can also subscribe to another mailing list called twsocket-announce which will receive only very few messages when major bug fixes or updates are done. The subscription process is the same as for the other mailing list. See above procedure. Release notes ------------- There is no global release notes. Each component and sample has his own history. You can find those histories in the comment in the beginning of each source file. There are also a bunch of useful comments in the source code. You should at least browse the source for the components you are interested in. MidWare ------- If you wants to build client/server applications using TCP/IP protocol, you can do it easily with ICS. But you can do it much more easily using another freeware product from Fran鏾is Piette: MidWare. Available from the same web site http://www.overbyte.be. francois.piette@overbyte.be francois.piette@swing.be http://www.overbyte.be/ http://wiki.overbyte.be/

21,882

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧