Hoi,
een klant van ons heeft een asp script laten schrijven om een mailtje via de web-mail server te laten versturen, voorzien van een tekst attachment, alleen hij claimt dat het aan de server ligt dat het niet werkt. Weet iemand toevallig wat er fout zou kunnen gaan bij dit script?
de foutmelding:
error '8007007e'
/test/test.asp, line 41
line 41 = Set objConfiguration = CreateObject("CDO.Configuration")
volledige code hieronder:
Alvast bedankt!
een klant van ons heeft een asp script laten schrijven om een mailtje via de web-mail server te laten versturen, voorzien van een tekst attachment, alleen hij claimt dat het aan de server ligt dat het niet werkt. Weet iemand toevallig wat er fout zou kunnen gaan bij dit script?
de foutmelding:
error '8007007e'
/test/test.asp, line 41
line 41 = Set objConfiguration = CreateObject("CDO.Configuration")
volledige code hieronder:
Alvast bedankt!
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
| <%
Dim EOL
Dim Bericht
Dim Onderwerp
Dim fsObj, tmpName, tmpPath
EOL = chr(13) & chr(10)
Bericht = ""
Bericht = Bericht & "DE TITEL" & EOL & EOL
Bericht = Bericht & "Korte uitleg" & EOL & EOL
Bericht = Bericht & "Naam: " & Request.Form("naam") & EOL
Bericht = Bericht & "Adres: " & EOL
Bericht = Bericht & Request.Form("adres") & EOL & EOL
Bericht = Bericht & "E-mail: " & Request.Form("email") & EOL
' first, create the file out of thin air
Set fsObj= Server.CreateObject("Scripting.FileSystemObject")
' temporary filename
tmpName = fsObj.GetTempName
' strip the .tmp extension
tmpName=Left(tmpName,Len(tmpName)-4)
' create the final temporary filename with the .txt extension
tmpPath=fsObj.GetSpecialFolder(2) & "\" & tmpName & ".txt"
'create the text file
Set tmpFile = fsObj.CreateTextFile(tmpPath, true)
'write the comma separated values to the file
tmpFile.WriteLine("naam, adres, email")
tmpFile.WriteLine(Request.Form("naam")& "," & Request.Form("adres") & "," & Request.Form("email"))
tmpFile.Close()
Onderwerp = "formulier: " & Request.Form("Naam")
Set objConfiguration = CreateObject("CDO.Configuration")
Set objFields = objConfiguration.Fields
Const cdoSendUsingPickup = 1
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
.Item("http://schemas.microsoft.com/cdo/configuration/[regel even afgebroken] smtpserverpickupdirectory") = "lokatie pickup directory"
.Update
End With
set email = CreateObject("CDO.Message")
email.Configuration = objConfiguration
email.To = "x@x.x"
email.From = "y@y.y"
email.Subject = Onderwerp
email.TextBody = Bericht
'email.BodyFormat = 0
'email.MailFormat = 0
email.AddAttachment(tmpPath) ' add the attachment to the email
email.Send()
set email = nothing
%> |
[ Voor 13% gewijzigd door Verwijderd op 30-09-2003 15:54 ]