Aspmail component Use Help

Source: Internet
Author: User
Mail component Aspmail component use Help
Written in front, in the following manual, there are 30 days of usage restrictions for any additional functional parts, and the following methods are used to remove the restriction:
If you get the "AspEmail ' premium features have expired" error message, run regedit, delete hkey_local_machine\software\persits software\ AspEmail then use regsvr32 to re-register the aspemail using. And then you can go on for another 30 days.

AspEmail 4.1 is an active service component that uses an external SMTP server to send e-mail messages in an ASP or VB environment. AspEmail 4.1 supports multiple recipients, multiple cc, multiple bcc, multiple attachments, HTML format, inline graphics, and non-US ASCII character set settings. AspEmail 4.1 is a completely free component, except for inline graphics, quoted-printable encoding support, and Message Queuing features that require additional purchase permission for this completely free aspemail to be downloaded at www.aspemail.com.


System Requirements:

General configuration requirements: Windows 95/98 or Windows NT 4.0+ an external SMTP service program

Special configuration requirements: Internet Information Server 3.0 + and Active Server Pages or personal Web server (any version) and Active Server Pages or visual B ASIC, Visual C + +, other development environments that support COM components


How do we get started?

First you need to register AspEmail on your system and execute the following command in your MS DOS or Start/run:

C:\>regsvr32 C:\AspEmailDir\AspEmail.dll

AspEmail is with AspUpload (Persits Software, Inc.) The component evaluation version is published together. This component is used to upload attachment files to the service side. (Translator: Of course, aspmail can also be used separately) register AspUpload execute the following command:

C:\>regsvr32 C:\AspEmailDir\AspUpload.dll

AspUpload does not need to run AspEmail. However, in the ASP SendMail example published with Aspmail, the aspupload is used to demonstrate the Aspmail attachment feature. So if you need to use this example, please also register aspupload (you can www.aspupload.com for more detailed information, but it is not free OH).


How to use AspEmail

The code for using AspEmail in an ASP environment is as follows:



In the VB environment using Aspmail code as follows, before using to project/references ... Select the Persits Software aspemail 4.1.

Dim Mail as MailSender

Set Mail = New MailSender


Mail.host = "Smtp.mycompany.com"

Mail.port = 25

Mail.from = "Sales@mycompany.com"

Mail.fromname = "Sales Department" optional


If you want to add messages to the recipient, CCs, BCCs, and reply-to, use AddAddress, ADDCC, ADDBCC and Addreplyto methods, respectively.

Each of these methods has two input parameters: an email address and an optional parameter name.

Mail.addaddress "jsmith@company1.com", "John Smith"

MAIL.ADDCC "bjohnson@company2.com" ' name is optional

Use the subject and Body properties to specify the subject and message text of the message, respectively. The body text can be either plain or HTML. If you want to use HTML format, you must set the IsHTML property to true. For example

Mail.subject = "Sales Receipt"

Mail.body = "Dear John:" & Chr (a) & Chr (a) & "Thank you for your business. This is your receipt.

or if

Mail.subject = "Sales Receipt"

Mail.body = "Dear John: ..."

mail.ishtml = True

If you are sending a file attachment, use the AddAttachment method. It uses the absolute path of the attachment as an input parameter. If you have multiple attachments, call this method multiple times. Note: do not use "=" to pass arguments

Mail.addattachment "C:\dir\receipt.doc"

Sending a message is calling the Send method. This method has an error when an exception occurs. You should choose to intercept this error message, which can be implemented using On Error Resume Next, for example:

On Error Resume Next

Mail.send

If Err <> 0 Then

Response.Write "An error occurred:" & Err.Description

End If

Support for encryption and digital electronic signatures based on S/MIME

Starting with Build 4.0.0.3, AspEmail can generate password and digital electronic signatures based on the industrial standard S/MIME format.

If a secret message is to be sent, AspEmail must be used in conjunction with the AspEncrypt password component (also Persits Software, Inc.). For more information, you can download the free AspEncrypt trial version www.aspencrypt.com

Extra features (not free to say): Support Queue messages

AspEmail If you are using basic functionality (which is the function described above), it is completely free. But its extra functionality requires you to purchase a registration license (you can also use it for 30 days free of charge). Can www.aspemail.com buy this stuff.

AspEmail 4.1 has a new method Sendtoqueue, which does not send mail directly to the SMTP server

Instead, the message is placed in the queue, which is sent by the Emailagent NT service. This is a background-run process. The code for sending mail in your ASP does not have to wait until the mail is sent to complete. This means that you will greatly improve the efficiency of the code and shorten the client wait time. The Emailagent service itself is completely free and can be downloaded www.aspemail.com/download.html. But just sendtoqueue methods need to purchase a registered key 30 days after you use it.

Extra features: Use inline graphics to send messages

AspEmail can send an e-mail message that contains graphics. Examples are as follows: (This example sends an email with background graphics)

...

Mail.body = "..."

Mail.addembeddedimage "C:\aspemaildir\margin.gif", "My-background-image"


The Addembeddedimage method has two input parameters: the absolute path of the graphics file and the content ID (is a string variable) the variable is formatted as follows:

"CID:"

In the example the variable content ID is "my-background-image" used to refer to the Background attribute of the flag. You can use the same technique to use this feature in a logo, as follows:

Mail.body = "..."

Mail.addembeddedimage "C:\aspemaildir\logo.gif", "My-company-logo"

To make your script more readable, you can choose to place your message text in a separate file, and then add the file to the body using the Appendbodyfromfile method. For example:














Thank for Shopping in our Online store!


....





To use the above file in your body, the code is as follows:

Mail.appendbodyfromfile "C:\aspemaildir\messagebody.html"

Mail.addembeddedimage "C:\aspemaildir\margin.gif", "My-background-image"

Additional features: Support for non-US-ASCII character sets

AspEmail can send a non-us-ascii character set,



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.