Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

Error message vb.script CDO

Hi!

Include the source for sending a email with attachment...
Working just fine on my computer.
I am using windows XP Pro.

Tryed the same code on my client PC.
And they are using Windows XP Pro olso...

But gat this error number:
80040220

Is there somthing missing in the source ?


' VB SCRIPT - AutosaveAndSend.vbs
' Lagrer vedlegg fra email til mappe VPIM (Navn lagret fil = N.txt
' Sender email til: production@edi.volvo.com med attatchment "CSV.XLC"
'
' NB! Outlock MÅ vere installert, for at skriptet skal fungere.
'
     sendemail "test@online.no","R3IN02T120001 40779","tor-er-b@online.no"
 
Sub sendemail(fraemail,subjekt,emailtil)
Dim objMessage
 
Set oFSO = CreateObject("Scripting.FileSystemObject")  ' Opretter filobjektet
Set objMessage = CreateObject("CDO.Message")
 
If oFSO.FileExists("C:\VPIM\F.txt") Then
'Sender email hvis CSV-filen er laget
    objMessage.Subject = subjekt
    objMessage.From = fraemail
    objMessage.To = emailtil
    objMessage.AddAttachment "c:\VPIM\N.txt"
    objMessage.Send  
End If

Open in new window

0
team2005
Asked:
team2005
  • 4
  • 3
1 Solution
 
sirbountyCommented:
Is the client behind another domain/isp?
You may have to add cdo configuration to setup the smtp address...
0
 
David LeeCommented:
Hi, team2005.

What's the text of the error message?
0
 
team2005Author Commented:
Hi!

Okey, how to setup config file ?

Can't give you the text.... Dident write it down.
But i know that the error was coming from
objMessage.Send



0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sirbountyCommented:
Well, it would depend on the environment - did you send it successfully from your provider and it failed from another?
Could be a lot of reasons...since I still don't know, here's an example of a cdo message with configuration fields added/updated:
See http://www.paulsadowski.com/WSH/cdo.htm for more detail.


Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "me@my.com"
objMessage.To = "test@paulsadowski.com"
objMessage.TextBody = "This is some sample message text."

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
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") = "smtp.myserver.com"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send
0
 
team2005Author Commented:
Hi!

Okey, i wil try this source on my client PC.
And come back to you, how it went...

Thanks for help...

Tor
0
 
team2005Author Commented:
Hi again!

Have testet your script sirbounty, but still gut problems

Maby some dll-file or somthing is missing ?


0
 
sirbountyCommented:
What problems/errors do you see?
0
 
team2005Author Commented:
Hi!

Found out of this myself..
The problem was that IIS, wasent installed..
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now