CDO Email

Discussion in 'Classic ASP' started by wkraemer, Oct 4, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have written and, on my local XP Pro OS, successfully tested Javascript code to ?send mail using CDO?:

    <%
    var ConfirmMessage = "";
    if (!LostPassword.EOF) {
    var sysMail = Server.CreateObject("CDO.Message");
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost";
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "";
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "";
    sysMail.Configuration.Fields.Update();
    sysMail.From = "[email protected]";
    sysMail.To = String(Request("EmailAddress"));
    sysMail.Subject = "Re:Your NYSOMS Login Information";
    sysMail.TextBody = "UserName: " + LostPassword.Fields("Email").value+"\n\rPassword: " + LostPassword.Fields("NYLicense").value;
    // sys.Mail.fields.update;
    sysMail.Send();
    ConfirmMessage = "Your login has been sent to: " + String(Request("EmailAddress"));
    }
    %>

    Using this code at DiscountASP.net the email is never sent. I am not sure how to convert the Q10078 sample code to Javascript. Can someone help?
     
  2. why dont you just use vbscript??
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Do you get any error?

    quote:Originally posted by wkraemer

    I have written and, on my local XP Pro OS, successfully tested Javascript code to ?send mail using CDO?:

    <%
    var ConfirmMessage = "";
    if (!LostPassword.EOF) {
    var sysMail = Server.CreateObject("CDO.Message");
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost";
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "";
    sysMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "";
    sysMail.Configuration.Fields.Update();
    sysMail.From = "[email protected]";
    sysMail.To = String(Request("EmailAddress"));
    sysMail.Subject = "Re:Your NYSOMS Login Information";
    sysMail.TextBody = "UserName: " + LostPassword.Fields("Email").value+"\n\rPassword: " + LostPassword.Fields("NYLicense").value;
    // sys.Mail.fields.update;
    sysMail.Send();
    ConfirmMessage = "Your login has been sent to: " + String(Request("EmailAddress"));
    }
    %>

    Using this code at DiscountASP.net the email is never sent. I am not sure how to convert the Q10078 sample code to Javascript. Can someone help?

    </blockquote id="quote"></font id="quote">

    B.

    DiscountASP.NET
    http://www.DiscountASP.NET
     
  4. Thanks bruce for response - No errors are reported, the Submit button in the form reacts to the mouseclick but no email is sent.

    rory asks 'why not simply using VBScript'. This answer is simple - I have to change a lot of other code along with it and am not familiar with VBScript.
     
  5. Thanks again Bruce - Problem solved. The error was NOT with the CDO Javascript code is was in a mispelled Form value. Thus, the Javascript CDO code works - I tested it at the discountASP.net 'localhost' with several database refrences and email addresses.

    Werner
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    Glad you fixed the problem.

    quote:Originally posted by wkraemer

    Thanks again Bruce - Problem solved. The error was NOT with the CDO Javascript code is was in a mispelled Form value. Thus, the Javascript CDO code works - I tested it at the discountASP.net 'localhost' with several database refrences and email addresses.

    Werner
    </blockquote id="quote"></font id="quote">

    B.

    DiscountASP.NET
    http://www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page