|
|
|
This is an example of how to send mail using .asp on our Windows 2000 server. Include the following code in your web page. You need to put the following definition metatags in the page BEFORE the <html> tag: <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" --> <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" --> Then in the body put the following code. I suggest you cut and paste this as the code is case sensitive. BE SURE to change the e-mail addresses to something appropriate or the script will send e-mail to me - you'll be frustrated that the script doesn't seem to work and I end up with lots of junk e-mail. <% Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.amplex.net"
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "mark@amplex.net"
.From = "webserver@amplex.net"
.Subject = "Message Subject"
.TextBody = "whatever you want in the body"
.Send
End With
%>
If you are an Amplex hosting customer use the SMTP server name given above,
otherwise enter your own mail server name.
BE SURE to change the e-mail addresses to something
appropriate or the script will send e-mail to me - you'll be frustrated that the
script doesn't seem to work and I end up with lots of junk e-mail.You can do a whole lot more with the CDO data objects than is shown with this example. Please refer to the Microsoft documentation if you would like more information (and you enjoy pain and suffering).
|
|
|