## AdvSMTP Example Code

The component allows you to send mail messages through any given SMTP server according to standard SMTP protocol. Access to the component can also be turned on at website basis like all other ASPFusion components. AdvSMTP is much more advance component for sending mail messages. The component provides these operations.

1. CC and BCC.

2. Multiple attachments.

3. Embedded images (a new feature provided by the component).

4. Chinese and other languages support and many other features like this.

5. Along with these basic operations, it provides Upload and UploadAs operations. Upload operation allows uploading single or multiple files at a time form client browser to the server. It also allows resolving the problem of name conflicting through the property NameConflict with possible values as Error (default), Skip, OverWrite and MakeUnique. UploadAs operation allows uploading single or multiple files at a time form client browser to the server with specified name. Only few lines of code is all to provide browser based file upload on the server.

6. No need to specify any external SMTP server for sending mail message. Component will lookup for reciepient's SMTP server and will send mail directly through reciepient's SMTP server without using any external SMTP server.

7. Both plain TEXT body and HTML body can be specified separately using two different methods.

8. The component can also perform logging for all sent mails.

The component send mails in two ways.

1. Blocking way, in which caller has to wait for the response from the component.

2. Non Blocking way, in which component returns control back to the caller and places a mail file in Spool folder, AdvSMTP service running at backend is then responsible to send all spooled mail messages.

Method Name | Method Description
SendMail | Send mail and caller has to wait for the response
SendQMail | Control is returned back to caller and mail is sent through service
Upload1 Upload2 | Upload file(s) to the given path
UploadAs1 UploadAs2 | Upload file(s) to the given path with given file name

Back

© 2005 ASPFusion