<%
Sub Sendmail (mail_to, mail_subject, mail_body)
'On error resume next
Dim jmail
Userip = request. servervariables ("http_x_forwarded_for ")
If userip = "" Then userip = request. servervariables ("remote_addr") 'get the real IP Address
Set jmail = server. Createobject ("jmail. Message ")
Jmail. Silent = true
Jmail. charset = "gb2312" 'character set, "US-ASCII" by default"
Jmail. isoencodeheaders = false
Jmail. mailserverusername = "sanmao-2000@163.com" 'mail account
Jmail. mailserverpassword = "*******" 'mail Password
Jmail. From = "sanmao-2000@163.com" 'sender's email address
Jmail. fromname = "liuyun" 'sender's name
Jmail. Subject = mail_subject 'sets the mail title
'Jmail. replyto = "liuyun-11912@163.com" 'specifies a return address
Jmail. Priority = 1
Jmail. addheader "originating-IP", userip' Add User-defined mail headers
Jmail. addrecipient (mail_to) 'recipient email address
Jmail. Body = mail_body 'mail body
Jmail. Send ("smtp.163.com") 'smtp address
Jmail. Close ()
Set jmail = nothing
Response. Write "Send OK ."
End sub
Call Sendmail ("deeone@tom.com", "mail test.", "Hi, now OK !!! ")
%>