Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. FORM Submit email not working using ASP

FORM Submit email not working using ASP

Scheduled Pinned Locked Moved ASP.NET
helphtmlcomquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GreatScott1
    wrote on last edited by
    #1

    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

    P O 2 Replies Last reply
    0
    • G GreatScott1

      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

      P Offline
      P Offline
      pmpdesign
      wrote on last edited by
      #2

      Wow, ASP. Thats going back a bit. Here is an example

      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")		= 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.

      1 Reply Last reply
      0
      • G GreatScott1

        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

        O Offline
        O Offline
        Om Prakash Pant
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups