Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VBSCRIPT email - error 0x800ccc15  (Read 4981 times)

0 Members and 1 Guest are viewing this topic.

Che_Epy

  • Guest
VBSCRIPT email - error 0x800ccc15
« on: October 16, 2006, 05:24:56 AM »
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 = "[email protected]"
objMessage.To = "[email protected]"
objMessage.From = "[email protected]"
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
« Last Edit: October 17, 2006, 01:32:42 AM by Che_Epy »