Question : Fields update failed Error with Email using the CDOSYS component

I've used CDOSYS email script, which worked perfectly until I needed to add in additional fields
Here is the code, i've renamed the smtp host (but the one I'm actually using does work)


Code Snippet:
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:
<%
 
  Option Explicit
 
  dim sName, sEmail, sMessage, sPhone, sAddress
	dim oCdoMail, oCdoConf, sConfURL
 
  if Request.Form("Action") <> "" then
    sName = Request.Form("Name")
    sEmail = Request.Form("Email")
	sPhone = Request.Form("Phone")
	sAddress = Request.Form("Address")
    sMessage = Request.Form("Message")
 
		Set oCdoMail = Server.CreateObject("CDO.Message")
		Set oCdoConf = Server.CreateObject("CDO.Configuration")
 
		sConfURL = "http://schemas.microsoft.com/cdo/configuration/"
 
		with oCdoConf
			.Fields.Item(sConfURL & "sendusing") = 4
			.Fields.Item(sConfURL & "smtpserver") = "smtp.domain.com"
			.Fields.Item(sConfURL & "smtpserverport") = 25
			.Fields.Update
		end with
 
		with oCdoMail
			.To = "[email protected]"
			.From = sEmail
			'.To = sEmail
			.Subject = " Enquiry"
			.TextBody = sMessage & vbCrLf & sPhone & vbCrLf & sEmail & vbCrLf & sAddress 
	
			'.HTMLBody = sMessage
			'.HTMLBody = sEmail
			'.HTMLBody = sPhone
			'.HTMLBody = sAddress
 
			.Configuration = oCdoConf
			.Send
		end with
 
		Set oCdoConf = Nothing
		Set oCdoMail = Nothing
 
    response.write "Thanks for your message!"
  else
%>
">

Name:

E-mail:

Telephone:

Address:

Enquiry:

<% end if %>
Open in New Window Select All

Answer : Fields update failed Error with Email using the CDOSYS component

Hmmm I came back to this today, and without any changes it now seems to be working.

Guess it was a local problem rather than a coding one :)
Random Solutions  
 
programming4us programming4us