Answer» Seeking help...
I tried to send email with attachment using CDO component. Prevoiusly I encounter this error:- The "SendUsing" configuration value is invalid
After add new few code, I had another error:- c:\script\send_email02.vbs(61, 1) (null): The message could not be SENT to the SMTP server. The transport error code was 0x800ccc15. The server response was not available
I`m using WinXP SP2. This script was executed from command prompt. REALLY seek your help guys... This is my code
'-------------------------------------------------------------- Dim fso, fsoFold, fsoFile
Set fso = CreateObject("Scripting.FileSystemObject") Set fsoFold = fso.getfolder("C:\temp\")
For Each fsoFile In fsoFold.Files sName = fsoFold + "\" & fsoFile.Name Next
Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "TEST file" objMessage.Sender = "[emailprotected]" objMessage.To = "[emailprotected]" objMessage.From = "[emailprotected]" objMessage.TextBody = "Test file" 'objMessage.AddAttachment sName
'-------------------------------------------------------------------------------- '==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.234.9.12"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
'Your UserID on the SMTP server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mys\ash030"
'Your password on the SMTP server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "test123"
'Server PORT (typically 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section== '--------------------------------------------------------------------------------
objMessage.Send()
Set objMessage = Nothing
|