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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp send mail

asp send mail

Scheduled Pinned Locked Moved ASP.NET
htmlcsscomtoolshelp
2 Posts 2 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.
  • S Offline
    S Offline
    swornavidhya_m
    wrote on last edited by
    #1

    I want to send mail from an asp page. The asp page is called from a html page. The sending mail using CDOSYS and CDO is not working properly. When i call the asp page from html page, the script for sending mail in the asp page is getting displayed while running rather than working of the process which i had mentioned in the script to work. The runtime problem is that, when the asp file is being called from html file the script is getting displayed rather than the process to get worked. HTML Code HTML and CSS Syntax (Toggle Plain Text)

    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    </head>

    <body>

    <form action=sendmail.asp method="POST">
    <p><input type="text" name="T1" size="20"></p>
    <p><input type="submit" value="Submit" name="B1">        
    <input type="reset" value="Reset" name="B2"></p>
    </form>

    </body>

    </html>

    ASP File "sendmail.asp" code
    *****************************

    HTML and CSS Syntax (Toggle Plain Text)
    <html>

    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    <%

    function sendmail()
    {

    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Sending email with CDO"
    myMail.From="rksvidhya@yahoo.com"
    myMail.To="swornavidhya.mahadevan@gmail.com"
    myMail.TextBody="This is a message."

        myMail.Configuration.Fields.Item \_
    	("http://schemas.microsoft.com/cdo/configuration/smtsperver") = "smtp.gmail.com";
       myMail.Configuration.Fields.Item \_
       ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;
       myMail.Configuration.Fields.Item \_
       ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
       myMail.Configuration.Fields.Item \_
       ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")= 1;
       myMail.Configuration.Fields.Item \_
       ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "true";  
       myMail.Configuration.Fields.Item \_
       ("http://schemas.microsoft.com
    
    S 1 Reply Last reply
    0
    • S swornavidhya_m

      I want to send mail from an asp page. The asp page is called from a html page. The sending mail using CDOSYS and CDO is not working properly. When i call the asp page from html page, the script for sending mail in the asp page is getting displayed while running rather than working of the process which i had mentioned in the script to work. The runtime problem is that, when the asp file is being called from html file the script is getting displayed rather than the process to get worked. HTML Code HTML and CSS Syntax (Toggle Plain Text)

      <html>
      <head>
      <meta http-equiv="Content-Language" content="en-us">
      <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
      <meta name="ProgId" content="FrontPage.Editor.Document">
      <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

      </head>

      <body>

      <form action=sendmail.asp method="POST">
      <p><input type="text" name="T1" size="20"></p>
      <p><input type="submit" value="Submit" name="B1">        
      <input type="reset" value="Reset" name="B2"></p>
      </form>

      </body>

      </html>

      ASP File "sendmail.asp" code
      *****************************

      HTML and CSS Syntax (Toggle Plain Text)
      <html>

      <head>
      <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
      <meta name="ProgId" content="FrontPage.Editor.Document">
      <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

      <%

      function sendmail()
      {

      Set myMail=CreateObject("CDO.Message")
      myMail.Subject="Sending email with CDO"
      myMail.From="rksvidhya@yahoo.com"
      myMail.To="swornavidhya.mahadevan@gmail.com"
      myMail.TextBody="This is a message."

          myMail.Configuration.Fields.Item \_
      	("http://schemas.microsoft.com/cdo/configuration/smtsperver") = "smtp.gmail.com";
         myMail.Configuration.Fields.Item \_
         ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;
         myMail.Configuration.Fields.Item \_
         ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
         myMail.Configuration.Fields.Item \_
         ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")= 1;
         myMail.Configuration.Fields.Item \_
         ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "true";  
         myMail.Configuration.Fields.Item \_
         ("http://schemas.microsoft.com
      
      S Offline
      S Offline
      Stryder_1
      wrote on last edited by
      #2

      Hi, You've created the function sendmail(), but never call it to execute. Either pull the code out of function and let it process as the page is processed, or add a call to the function at the end of your script block.

      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