这位仁兄,你可能没 看自己以前发过的帖子吧.
我在你以前的帖子上 已回答了:
http://www.csdn.net/expert/topic/703/703472.xml?temp=.1222803===================================================================
' ***************************************************************
' Script To Send JMail Message
' ***************************************************************
' ***************************************************************
' ***************** VERY VERY IMPORTANT !!!! *****************
'
' In order for this utility to function correctly, JMail must be
' registered on your computer. Assuming you place the jmail.dll
' in the Windows System folder, the syntax for registering the
' JMail dll is as follows:
'
' regsvr32 "C:\Windows\System\jmail.dll"
'
' For Win NT and Win 2000, the folder is System32 and syntax is:
'
' regsvr32 "C:\WINNT\System32\jmail.dll"
'
' ***************************************************************
' ***************************************************************
' Brief Explanation of Code:
' ---------------------------------------------------------------
' The user is presented with a series of Input Boxes to collect the
' information necessary to create and send the mail item.
'
' Server Example: pop.uswest.net
' User Name Example: MrYadaUser (may leave blank)
' User Password Example: 123SecretPWD (may leave blank)
'
' Recipient Address Example: [email protected]
' Message Subject Example: So, how have you been?
' Message Body Text Example: Blah, blah, blah
'
' ***************************************************************' Declare Variables (as variants)
Dim objJMail, strFrom, strMsg
Dim strServer, strUID, strPWD
Dim strRecipient , strSubject, strBodyText' Collect information from user about Server
strServer = InputBox("What is your Mail Server?","JMail")
strUID = InputBox("Enter User Name (optional)", "JMail")
strPWD = InputBox("Enter Password (optional)", "JMail")' Collect information from user about Message
strMsg = "Enter recipient mail address." & vbCrLf & "(Format: [email protected])"
strReceipent = InputBox(strMsg, "JMail", "[email protected]")strMsg = "Enter subject line."
strSubject = InputBox(strMsg, "JMail", "Message from JMail")strMsg = "Enter message text."
strBodyText = InputBox(strMsg, "JMail", "Wow! JMail works!")' Create the JMail message Object
set objJMail = CreateOBject( "JMail.Message" )' Set silent to true as we wish to handle our errors ourself
' And set logging to true to ease any potential debugging
objJMail.silent = true
objJMail.Logging = true' Most mail servers require a valid email address for the sender
objJMail.From = "[email protected]"
objJMail.FromName = "My Realname"' Next we have to add some recipients. The addRecipients method
' can be used multiple times. Note: name (2nd param)is optional.
objJMail.AddRecipient strReceipent, strReceipent' Add additional recipients if desired (disabled here)
'objJMail.AddRecipient "[email protected]"' Provide a subject for the message
objJMail.Subject = strSubject' The body property is both read and write. If you want to append
' text to the body you can use this syntax:
' objJMail.Body = objJMail.Body & "Hello world!"
'
' or you can use objJMail.AppendText "Hello World! " which in many
' cases is easier to use.
objJMail.Body = strBodyText' 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 typically use the Message objects Text
' property to do something like this:
' SaveMessageDraft( objJMail.Text )
'
' Note that this function call is only an example. The function
' does not exist by default, you have to create it yourself.If Len(strUID) Then objJMail.MailServerUserName = strUser
If Len(strPWD) Then objJMail.MailServerPassWord = strPassword' To send the message, you use the Send() method, which takes one
' parameter that should be your mail server's address. To capture
' any potential errors, we wrap the call in an IF statement
'
If Not objJMail.Send(strServer) then
MsgBox objJMail.log
Else
MsgBox "Message sent successfully!"
End If
我在你以前的帖子上 已回答了:
http://www.csdn.net/expert/topic/703/703472.xml?temp=.1222803===================================================================
' ***************************************************************
' Script To Send JMail Message
' ***************************************************************
' ***************************************************************
' ***************** VERY VERY IMPORTANT !!!! *****************
'
' In order for this utility to function correctly, JMail must be
' registered on your computer. Assuming you place the jmail.dll
' in the Windows System folder, the syntax for registering the
' JMail dll is as follows:
'
' regsvr32 "C:\Windows\System\jmail.dll"
'
' For Win NT and Win 2000, the folder is System32 and syntax is:
'
' regsvr32 "C:\WINNT\System32\jmail.dll"
'
' ***************************************************************
' ***************************************************************
' Brief Explanation of Code:
' ---------------------------------------------------------------
' The user is presented with a series of Input Boxes to collect the
' information necessary to create and send the mail item.
'
' Server Example: pop.uswest.net
' User Name Example: MrYadaUser (may leave blank)
' User Password Example: 123SecretPWD (may leave blank)
'
' Recipient Address Example: [email protected]
' Message Subject Example: So, how have you been?
' Message Body Text Example: Blah, blah, blah
'
' ***************************************************************' Declare Variables (as variants)
Dim objJMail, strFrom, strMsg
Dim strServer, strUID, strPWD
Dim strRecipient , strSubject, strBodyText' Collect information from user about Server
strServer = InputBox("What is your Mail Server?","JMail")
strUID = InputBox("Enter User Name (optional)", "JMail")
strPWD = InputBox("Enter Password (optional)", "JMail")' Collect information from user about Message
strMsg = "Enter recipient mail address." & vbCrLf & "(Format: [email protected])"
strReceipent = InputBox(strMsg, "JMail", "[email protected]")strMsg = "Enter subject line."
strSubject = InputBox(strMsg, "JMail", "Message from JMail")strMsg = "Enter message text."
strBodyText = InputBox(strMsg, "JMail", "Wow! JMail works!")' Create the JMail message Object
set objJMail = CreateOBject( "JMail.Message" )' Set silent to true as we wish to handle our errors ourself
' And set logging to true to ease any potential debugging
objJMail.silent = true
objJMail.Logging = true' Most mail servers require a valid email address for the sender
objJMail.From = "[email protected]"
objJMail.FromName = "My Realname"' Next we have to add some recipients. The addRecipients method
' can be used multiple times. Note: name (2nd param)is optional.
objJMail.AddRecipient strReceipent, strReceipent' Add additional recipients if desired (disabled here)
'objJMail.AddRecipient "[email protected]"' Provide a subject for the message
objJMail.Subject = strSubject' The body property is both read and write. If you want to append
' text to the body you can use this syntax:
' objJMail.Body = objJMail.Body & "Hello world!"
'
' or you can use objJMail.AppendText "Hello World! " which in many
' cases is easier to use.
objJMail.Body = strBodyText' 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 typically use the Message objects Text
' property to do something like this:
' SaveMessageDraft( objJMail.Text )
'
' Note that this function call is only an example. The function
' does not exist by default, you have to create it yourself.If Len(strUID) Then objJMail.MailServerUserName = strUser
If Len(strPWD) Then objJMail.MailServerPassWord = strPassword' To send the message, you use the Send() method, which takes one
' parameter that should be your mail server's address. To capture
' any potential errors, we wrap the call in an IF statement
'
If Not objJMail.Send(strServer) then
MsgBox objJMail.log
Else
MsgBox "Message sent successfully!"
End If
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货