⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messageobject.asp

📁 上传文件的asp程序,好不好用自己用了才知道
💻 ASP
字号:
<% @ LANGUAGE = VBSCRIPT %>
<html>
<body>
<%

'*************************************************
'*                                               *
'*   Produced by Dimac                           *
'*                                               *
'*   More examples can be found at 				 *
'*   http://tech.dimac.net                       *
'*                                               *
'*   Support is available at our helpdesk        *
'*   http://support.dimac.net                    *
'*                                               *
'*   Our main website is located at              *
'*   http://www.dimac.net                        *
'*                                               *
'*************************************************

	' Create the JMail message Object
	set msg = Server.CreateOBject( "JMail.Message" )

	' Set logging to true to ease any potential debugging
	' And set silent to true as we wish to handle our errors ourself
	msg.Logging = true
	msg.silent = true

	' Most mailservers require a valid email address
	' for the sender
	msg.From = "test@mydomain.com"
	msg.FromName = "My Realname"
	
	' Next we have to add some recipients.
	' The addRecipients method can be used multiple times.
	' Also note how we skip the name the second time, it
	' is as you see optional to provide a name.
	msg.AddRecipient "recipient@hisDomain.com", "His Name"
	msg.AddRecipient "recipientelle@herDomain.com"	
	
	
	' The subject of the message
	msg.Subject = "How you doin?"

	' The body property is both 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.
	'
	' Note the use of vbCrLf to add linebreaks to our email
	msg.Body = "Hello Jim" & vbCrLf & vbCrLf & "How's it going? ..."

	' There.. we have now succesfully created our message. 
	' Now we can either send the message or save it as a draft in a Database.
	' To save the message you would typicly use the Message objects Text property
	' to do something like this:
	'
	' SaveMessageDraft( msg.Text )
	' Note that this function call is only an example. The function does not
	' exist by default, you have to create it yourself.
	
	
	' If i would like to send my message, you use the Send() method, which
	' takes one parameter that should be your mailservers address
	'
	' To capture any errors which might occur, we wrap the call in an IF statement
	if not msg.Send( "mail.myDomain.net" ) then
		Response.write "<pre>" & msg.log & "</pre>"
	else
		Response.write "Message sent succesfully!"
	end if
	
	
	' And we're done! the message has been sent.


%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -