synergiq
asked on
asp email xp
hi can someone please post a simple scrpt to send emails out via iis using windows xp, i can get this working on server but not on local install.
ASKER
here is what i currently have on the server, this however does not work on xp.
<%
Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configur ation")
With cdoConfig.Fields
'Set CDO Port
.Item(sch & "sendusing") = 2
'Set mailserver name either IP address, mail.yoursite.com or localhost
.Item(sch & "smtpserver") = MailServer
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport") = 25
'Set number of seconds before timeout
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message" )
With cdoMessage
Set .Configuration = cdoConfig
.From = MailFrom
.To = var_email
.Subject = var_Customer_Address&" (ELECTRIC)"
.HTMLBody = var_Customer_Address&" (ELECTRIC)"
.AddAttachment gas_out_box_install&var_fo rmname
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
<%
Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configur
With cdoConfig.Fields
'Set CDO Port
.Item(sch & "sendusing") = 2
'Set mailserver name either IP address, mail.yoursite.com or localhost
.Item(sch & "smtpserver") = MailServer
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport") = 25
'Set number of seconds before timeout
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message"
With cdoMessage
Set .Configuration = cdoConfig
.From = MailFrom
.To = var_email
.Subject = var_Customer_Address&" (ELECTRIC)"
.HTMLBody = var_Customer_Address&" (ELECTRIC)"
.AddAttachment gas_out_box_install&var_fo
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
> .Item(sch & "smtpserver") = MailServer
You need to change this to the SMTP address of your mailserver. Locally you can setup an SMTP server in IIS OR you can point it directly to your ISP's Mailserver. (but you may be required to change this when you put it into a production environment)
You need to change this to the SMTP address of your mailserver. Locally you can setup an SMTP server in IIS OR you can point it directly to your ISP's Mailserver. (but you may be required to change this when you put it into a production environment)
ASKER
I have set the MailServer variable to my remote mail server, but that still does not work here is the error message I am getting.
(0x8004020F)
The event class for this subscription is in an invalid partition
/mobliq/inc_write_install. asp, line 1075
line 1075 reads
<%
Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configur ation")
With cdoConfig.Fields
'Set CDO Port
.Item(sch & "sendusing") = 2
'Set mailserver name either IP address, mail.yoursite.com or localhost
.Item(sch & "smtpserver") = MailServer
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport") = 25
'Set number of seconds before timeout
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message" )
With cdoMessage
Set .Configuration = cdoConfig
.From = MailFrom
.To = var_email
.Subject = var_Customer_Address&" (INSTALL)"
.HTMLBody = var_Customer_Address&" (INSTALL)"
.AddAttachment gas_out_box_survey&var_for mname
.Send <------------------------- ---------- ---------- ---------- ---------- ---1075
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
(0x8004020F)
The event class for this subscription is in an invalid partition
/mobliq/inc_write_install.
line 1075 reads
<%
Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configur
With cdoConfig.Fields
'Set CDO Port
.Item(sch & "sendusing") = 2
'Set mailserver name either IP address, mail.yoursite.com or localhost
.Item(sch & "smtpserver") = MailServer
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport") = 25
'Set number of seconds before timeout
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message"
With cdoMessage
Set .Configuration = cdoConfig
.From = MailFrom
.To = var_email
.Subject = var_Customer_Address&" (INSTALL)"
.HTMLBody = var_Customer_Address&" (INSTALL)"
.AddAttachment gas_out_box_survey&var_for
.Send <-------------------------
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you using CDONTS ?