精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● ASP>>邮件编程>>Jmail发信的例子

主题:Jmail发信的例子
发信人: qcrsoft(网痞)
整理人: qcrsoft(2002-02-04 03:26:02), 站内信件
作者: 飞刀  
下面是一个用Jmail发信的例子,Jmail是一个发信的免费组件,你可以在本站点的组件搜索看到它。

<%Set JMail = Server.CreateObject("JMail.SMTPMail")

' This is my local SMTP server
JMail.ServerAddress = "mail.<your domain here>"

' This is me.... 
JMail.Sender = "[email protected]"
JMail.Subject = "Here you go..."

' Get the recipients mailbox from a form.
JMail.AddRecipient Request.Form("email")

' The body property is bodth read and write.
' If you want to append text to the body you can
' use JMail.Body = JMail.Body & "Hello world!"
' or you can use JMail.AppendText "Hello World!"
' which in many cases is easier to use.
JMail.Body = "Here you go. Your request has been approved"_
"and the program is attached to this message"


' 1 - highest priority (Urgent)
' 3 - normal
' 5 - lowest

JMail.Priority = 1

JMail.AddHeader "Originating-IP",Request.ServerVariables("REMOTE_ADDR")

' Must make sure that IUSR_???? has access to the following files.
JMail.AppendBodyFromFile "e:\mail\standard_footer.txt"
JMail.AddAttachment "e:\products\MyProduct.exe"

' Send it...
JMail.Execute 

%>

[关闭][返回]