Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2007, 01:22 AM
Authorized User
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default CDOSYS Mail component error

hi,
i m using a script to get info from a form page and send the info using CDOSYS mail component to mail the information get from the form. i using CDOSYS component to send a html format of informaiton...i m getting the following error;

error '8004020e'
/contactmail.asp, line 83


and below is the code of the page;

<%
Dim MailTo
Dim mailcomp
Dim smtp
Dim From

From = request.form("uname")

MailTo = request.form("email")


mailcomp = "CDOSYS"


smtp = "smtp.hubli-dharwadbazaar.com"

%>
<%
Dim html
html = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"""
html = html & """http://www.w3.org/TR/html4/loose.dtd"">"
html = html & "<html>"
html = html & "<head>"
html = html & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">"
html = html & "<title>Messege From Add Viewer</title>"
html = html & "</head>"
html = html & "<body>"
html = html & "<p>" & Request.Form("uname")& "(" & Request.Form("uemail")& ") has viewed your Add on Hubli-Dharwadbazaar.com <br>"
html = html & "and sent replay / Enquiry /Query for your Add</p>"
html = html & "<p><strong>Sender Details:</strong><br>"
html = html & "Sender Name :" & Request.Form("uname")
html = html & "<br>Sender E-Mail :" & Request.Form("uemail")
html = html & "<br>"
html = html & "<strong>Personal message from manju: </strong><br>"
html = html & "------------------------------------------------------------ <br>"
html = html & "" & Request.Form("msg")& ""
html = html & "------------------------------------------------------------ <br>"
html = html & "If you have any questions, please visit our FAQ page at <br>"
html = html & "<a href=""http://www.hubli-dharwadbazaar.com/feedback.asp"">http://www.hubli-dharwadbazaar.com/feedback.asp</a> <br>"
html = html & "or contact us at <br>"
html = html & "<a href=""http://www.hubli-dharwadbazaar.com/contactus.asp"">http://www.hubli-dharwadbazaar.com/contactus.asp</a> <br>"
html = html & "<br>"
html = html & "Support Team, <br>"
html = html & "hubli-DharwadBazaar.com Classifieds <br>"
html = html & "http://www.hubli-dharwadbazaar.com <br> "
html = html & "================================================= =========== <br>"
html = html & "ABOUT THIS E-MAIL<br> "
html = html & "================================================= =========== <br>"
html = html & "This E-Mail is generated by a site visitor accessing the<br>"
html = html & "Viewing Adds service.</p>"
html = html & "</body>"
html = html & "</html>"
%>
<%

if mailcomp = "CDOSYS" then
    set imsg = createobject("cdo.message")
    set iconf = createobject("cdo.configuration")
    Set Flds = iConf.Fields
    With Flds
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtp
   .Update
   End With
   With iMsg
   Set .Configuration = iConf
        .To = MailTo
        .From = From
        .Subject = Request.Form("Subject")
        .HTMLBody = HTML
        .fields.update
        .Send End With --------> Error line
    set imsg = nothing
    set iconf = nothing
    set HTML = nothing
else

if mailcomp = "CDONTS" then
   Dim Avanos
   Set Avanos = CreateObject("CDONTS.NewMail")
    Avanos.From= From
    Avanos.To= MailTo
    Avanos.Subject= Request.Form("Subject")
    Avanos.BodyFormat=0
    Avanos.MailFormat=0
    Avanos.Body=HTML
    Avanos.Send
    set HTML = nothing
    set Avanos=nothing
    else

if mailcomp = "ASPEmail" then
    Set WSweb = Server.CreateObject("Persits.MailSender")
    WSweb.Host = smtp
    WSweb.From = From
    WSweb.AddAddress MailTo
    WSweb.Subject = Request.Form("Subject")
    WSweb.Body = HTML
    WSweb.IsHTML = True
    WSweb.Send
    set WSweb = Nothing
    set HTML = Nothing
    else

if mailcomp = "JMail" then
    set msg = Server.CreateObject( "JMail.Message" )
    msg.Logging = true
    msg.ContentType = "text/html"
    msg.From = From
    msg.AddRecipient = MailTo
    msg.Subject = Request.Form("Subject")
    msg.Body = HTML
    msg.Send( smtp )
    Set msg = Nothing
    set HTML = Nothing

end if
end if
end if
end if
%>

so what is the problem here?...........
thnx in advance
shri

shri
__________________
shri
 
Old May 5th, 2007, 06:01 AM
Authorized User
 
Join Date: May 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Check the value for the variable MailTo, [u]looks like the value is having invalid charecter or is in invalid email format</u>.


Ragards,
Akash - The Sky





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Mail Using CDOSYS in ASP artarasan Classic ASP Basics 1 May 12th, 2008 06:11 PM
mail through cdosys.dl Amit singla ASP.NET 1.0 and 1.1 Professional 3 October 26th, 2006 06:41 AM
How do you use CDOSYS mail SoC Classic ASP Basics 5 April 20th, 2005 10:56 PM
E-Mail Component smitddv VB Components 0 February 20th, 2004 02:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.