You can send messages through the JMail component. First you install the JMail component on the Web server. The following is an object instance that can be invoked via call SendMail (receive) to send mail
You can send messages through the JMail component.
First you install the JMail component on the Web server.
The following is an object instance that can be invoked via call SendMail (receive) to send mail
<%
Sub SendMail (receive)
On Error Resume Next
Set JMail = Server.CreateObject ("JMail. Message ")
Jmail.silent = False ' mask exception error, return False to true two value
Jmail.logging = True ' Enable mail logging
JMail. Charset = "gb2312"
JMail. AddRecipient receive ' Mail Recipient's address
JMail. from = "admin@XXX.com.cn" ' e-mail address of sender
JMail. FromName = "Subject" ' Sender name
JMail. Mailserverusername = "Admin" Mailbox user name
JMail. Mailserverpassword = "xxx" ' Mailbox password
JMail. Subject = "message" ' Mail subject
JMail. BODY = "Body" ' mail content
JMail. Priority = 3 ' Mail Emergency program, 1 for fastest, 5 for slowest, 3 for default value
mailserver= "Smtp.xxx.net" ' Outgoing server
JMail. Send (mailserver) ' Perform mail delivery (via mail server address)
If Err.number<>0 Then
Sendmsg= "Send failed! "
Else
Sendmsg= "has been sent! "
End If
Response.Write (sendmsg)
JMail. Close ()
Set jmail=nothing
End Sub
%>
JMail components can be downloaded online