FORM Submit email not working using ASP
-
I am an experienced programmer but a novice at ASP. Attempting a CDO email and when I click submit an HTML page appears with my ASP code listed at the top. My HTML page form begins with:
and then i have a standard form object with a submit button. for now, the entire content of aspmailform.asp code file is simply: <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="myrealemailaddress@myrealemailcompany.com" myMail.TextBody="This is a message." myMail.Send set myMail=nothing %> ------ Any ideas what error would cause the ASP code to appear in the browser instead of running? Thanks for your help! - Scott
-
I am an experienced programmer but a novice at ASP. Attempting a CDO email and when I click submit an HTML page appears with my ASP code listed at the top. My HTML page form begins with:
and then i have a standard form object with a submit button. for now, the entire content of aspmailform.asp code file is simply: <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="myrealemailaddress@myrealemailcompany.com" myMail.TextBody="This is a message." myMail.Send set myMail=nothing %> ------ Any ideas what error would cause the ASP code to appear in the browser instead of running? Thanks for your help! - Scott
Wow, ASP. Thats going back a bit. Here is an example
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.FieldsWith Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With strDesc = "Message contents" With iMsg Set .Configuration = iConf .To = "myrealemailaddress@myrealemailcompany.com" .From = "mymail@mydomain.com" .Sender = "mymail@mydomain.com" .ReplyTo = "mymail@mydomain.com" .Subject = "Sending email with CDO" .textbody = strDesc .Send End With Set iConf= Nothing
You may have to tweak it a little, but should work. Make sure IIS is configured to serve ASP pages as well. I don't think IIS 6+ is configured to do so by default.
-
I am an experienced programmer but a novice at ASP. Attempting a CDO email and when I click submit an HTML page appears with my ASP code listed at the top. My HTML page form begins with:
and then i have a standard form object with a submit button. for now, the entire content of aspmailform.asp code file is simply: <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="myrealemailaddress@myrealemailcompany.com" myMail.TextBody="This is a message." myMail.Send set myMail=nothing %> ------ Any ideas what error would cause the ASP code to appear in the browser instead of running? Thanks for your help! - Scott
Please check the following link for more examples and explanation http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html[^]
Om Prakash Pant