|
barking mad -> cdosys problem (6/13/2008 16:07:44)
|
I don't understand why my ewebforms arent sending emails out from the server the error message reads as follows: error '8004020f' /test2.asp, line 41 interestingly if i send an email to an address on the server it goes to them AND the cc goes to my yahoo email account BUT if isend an email to my own email addrss on another server it doesnt go nor does the yahoo cc email HOWEVER if i send an email to any yahoo a/c th cc goes AND the intended recipient 's yahoo a/c gets the mail here's the code
<%
Option Explicit
dim sName, sEmail, sMessage
dim oCdoMail, oCdoConf, sConfURL
if Request.Form("Action") <> "" then
sName = Request.Form("Name")
sEmail = Request.Form("Email")
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") = 2
.Fields.Item(sConfURL & "smtpserver") = "localhost"
.Fields.Item(sConfURL & "smtpserverport") = 25
.Fields.Update
end with
with oCdoMail
.From = "email@domainonthisserver.co.uk"
.To = sEmail
.CC = "myemail@yahoo.co.uk"
.Subject = "My message subject"
.TextBody = sMessage
.HTMLBody = sMessage
.Configuration = oCdoConf
.Send
end with
Set oCdoConf = Nothing
Set oCdoMail = Nothing
response.write "Thanks for your message!"
else
%>
<form method="post" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<p>Name:<br /><input type="text" name="Name" /></p>
<p>E-mail:<br /><input type="text" name="Email" /></p>
<p>Message:<br /><textarea name="Message"></textarea></p>
<p><input type="submit" name="Action" value="Send" /></p>
</form>
<%
end if
%>
help!! this is driving me nuts! resolved it I had the target email address listed on the server where the form resides but no email address set up. The mail component was trying to send it locally but it was failing, i& wasnt receiving it because my email (the target address) was/is set up on another server. So in essence it was conflicting! So the code works fine!!!
|
|
|
|