Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 4th, 2006, 01:35 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default Email Code: Error: "SendUsing" invalid

I started to post this under the post that already states "email code" but i decided to post this separately--being that I'm not sure what it is he was/is trying to do and we could be asking about two different things.  But if not, maybe this will help him too.

So, I'm trying to have an email sent to certain ppl when a new form is created on my page.  Everything seems to be working fine, but when I hit submit I get this error regarding my e-mail object...

Error Type:
CDO.Message.1 (0x80040220)
The "SendUsing" configuration value is invalid.
/testecp1/postModify1.asp, line 142

I'd be getting the same msg on my other page that sends an email when a new form is created but I commented it out.  This is what I have:


[...code...]PostNew1.asp[...code...]

pRS.open "INSERT INTO ecpForms (ecpNumber, ecpTitle, ecpFilename, ecpOriginator, ecpDateDistributed, ecpDateDue) VALUES ('" & pEcpNumber & "', '" & pEcpTitle & "', '" & pEcpFilename & "', '" & pEcpOriginator & "', '" & pEcpDateDistributed & "', '" & pEcpDateDue & "') ", pConnection

    response.write "Success. File saved to  " & o.FileFullPath

    emailMessage = "Do not reply.  This is an automatic email." & Chr(13)
    emailMessage = emailMessage & "ECP Number: " & pEcpNumber & Chr(13)
    emailMessage = emailMessage & "ECP Title: " & pEcpTitle & Chr(13) & Chr(13)
    emailMessage = emailMessage & "New ECP form just posted on forum." & Chr(13) & Chr(13)
    emailMessage = emailMessage & "Check details on https.com"

    Set objMail = Server.CreateObject("CDO.Message")
    objMail.From = Session("UserEmail")
    objMail.Subject = "ECP Number: " & pEcpNumber & " -- " & pEcpTitle

    objMail.To = "someemails.mil"
    'objMail.To = "someemails.net"
    objMail.Cc = "someemails.com"
    objMail.Bcc = "someemails.com"

    objMail.TextBody = emailMessage
   ' objMail.Send

    Response.Redirect("viewAll1.asp")

  else
    response.write "Failed due to the following error: " & o.Error
  end if

end if
set o = nothing

[...code...]

******************************
[...code...] PostModify1.asp [...code...]

if mEcpSubmitEmail = "" then
  mEcpSubmitEmail = False
end if
if mEcpCostSubmitEmail = "" then
  mEcpCostSubmitEmail = False
end if


if (mEcpMV22PilotSubmit = "True") and (mEcpMV22AircrewSubmit = "True") and (mEcpMV22MaintenanceSubmit = "True") and (mEcpCV22AircrewSubmit = "True") and (mEcpCV22MaintenanceSubmit = "True") and (mEcpSubmitEmail = "False") then

  allComments = "Comments for all tracks posted.  The ECP Form is ready for costing." & Chr(13)

  emailMessage = "Do not reply.  This is an automatic email." & Chr(13)
  emailMessage = emailMessage & "ECP ID: " & mECPID & Chr(13)
  emailMessage = emailMessage & "ECP Number: " & mEcpNumber & Chr(13)
  emailMessage = emailMessage & "ECP Title: " & mEcpTitle & Chr(13) & Chr(13)
  emailMessage = emailMessage & allComments & Chr(13)
  emailMessage = emailMessage & "Check details on https.com"

  Set objMail = Server.CreateObject("CDO.Message")
  objMail.From = Session("UserEmail")
  objMail.Subject = "ECP Number: " & mEcpNumber & " All comments have been posted"
  objMail.To = "some@someemail.com"
  objMail.Cc = "someguy@someplace.mil"
  objMail.Bcc = "somewhere@somehow.com"

  objMail.TextBody = emailMessage
  objMail.Send

  mEcpSubmitEmail = True

end if


%>

[...end code...]

If I can just get this lasttttt little gliche to work that's it for this particular program!  Thanks a bunch! :)


Toni Burgess
misskaos99@yahoo.com
__________________
T.B.
misskaos99@yahoo.com
Reply With Quote
  #2 (permalink)  
Old October 4th, 2006, 02:01 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If memory serves me thats a CDONTS error; in any case it looks like you took CDONTS code and just changed the library to CDO, you might want to try something along these lines:

    Dim schema
    Dim cdoConf
    Dim cdoMsg

    schema = "http://schemas.microsoft.com/cdo/configuration/"

    Set cdoConf = CreateObject("CDO.Configuration")

    With cdoConf.Fields
        .Item(schema & "sendusing") = 2 'The CDO Sendusing Port
        .Item(schema & "smtpserver") = "MailServerGoes here"
        .update
    End With

    Set cdoMsg = CreateObject("CDO.Message")

    With cdoMsg
        Set .Configuration = cdoConf
        .From = "someone@somewhere.com"
        .To = "someone@somewhere.com"
        .Subject = "Subject"
        .TextBody = "Msg Body"
        .Send
    End With

    Set cdoMsg = Nothing






--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #3 (permalink)  
Old October 4th, 2006, 03:16 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

Dude you are most definitely a programmers miracle!

Quote:
quote:Originally posted by dparsons
 If memory serves me thats a CDONTS error; in any case it looks like you took CDONTS code and just changed the library to CDO, you might want to try something along these lines:

    Dim schema
    Dim cdoConf
    Dim cdoMsg

    schema = "http://schemas.microsoft.com/cdo/configuration/"
 
    Set cdoConf = CreateObject("CDO.Configuration")
 
    With cdoConf.Fields
        .Item(schema & "sendusing") = 2 'The CDO Sendusing Port
        .Item(schema & "smtpserver") = "MailServerGoes here"
        .update
    End With
 
    Set cdoMsg = CreateObject("CDO.Message")
 
    With cdoMsg
        Set .Configuration = cdoConf
        .From = "someone@somewhere.com"
        .To = "someone@somewhere.com"
        .Subject = "Subject"
        .TextBody = "Msg Body"
        .Send
    End With
 
    Set cdoMsg = Nothing






--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #4 (permalink)  
Old October 4th, 2006, 03:18 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Naw, just experienced; glad it worked out for you.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #5 (permalink)  
Old October 4th, 2006, 03:25 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

;)

Quote:
quote:Originally posted by dparsons
 Naw, just experienced; glad it worked out for you.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #6 (permalink)  
Old December 9th, 2009, 10:57 AM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default the sendusing configuration value is invalid.

the sendusing configuration value is invalid.

please help

mails are going from my local server when i update the code in live server
its say the sendusing configuration value is invalid.

please help me
Reply With Quote
  #7 (permalink)  
Old December 9th, 2009, 11:34 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Show me the code you are using. The only thing you could do to my above code is add the port info so:

vbscript Code:
With cdoConf.Fields
        .Item(schema & "sendusing") = 2 'The CDO Sendusing Port
        .Item(schema & "smtpserver") = "MailServerGoes here"
        .Item(schema & "smtpserverport") = "MailServer Port Goes Here" 
        .update
    End With

This shouldn't matter, the default value is 25 which is the default port that SMTP listens on. You can try it however.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
Reply With Quote
  #8 (permalink)  
Old October 25th, 2010, 04:16 AM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default same problem with my code

hey i have the same problem..
it is working on local and i am getting the mail too but it is not working on sever.

my code is as below..


hello friends i have put

<customErrors mode="Off"/> in my web.config.
now i am getting new error.
it is saying

The "SendUsing" configuration value is invalid.

you can check it here on submitting enquiry information.


http://www.mascotbpo.com/Contact.aspx


i have written this code to send information on my email id
Code:

using System.Web.Mail;
using System.Net.Mail;


public partial class Contact : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void send(object sender, EventArgs e)
    {

//send mail

        System.Web.Mail.MailMessage msgMail = new System.Web.Mail.MailMessage();

        msgMail.To = "xyz@123.com";
        msgMail.From = email.Text;
        msgMail.Subject = "Enquiry";
        msgMail.BodyFormat = MailFormat.Html;
        string strBody = "<html><body><b> Enquiry</b>" +
              " <font><p></p><p><b>Name:</b> " + name.Text + "</p><p><b>Compamy:</b> " + company.Text + "</p><p><b>Contact: </b>" + txtcontact.Text + "</p><p><b>Email: </b>" + email.Text + "</p><p><b>Address: </b>" + address.Text + "</p><p><b>City: </b>" + city.Text + "</p><p><b>Message: </b>" + message.Text + "</p></font></body></html>";
        msgMail.Body = strBody;

        SmtpMail.Send(msgMail);

        Response.Redirect("enquiry.aspx");


    }
}
and there is one more error on career page

Invalid mail attachment 'css.txt'.

http://www.mascotbpo.com/Career.aspx

i have written this code to attach txt or doc file in mail and send mail.
Code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Web.Mail;
using System.Net.Mail;

public partial class career : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
      
        string filePath = FileUpload1.PostedFile.FileName;
        string filename = Path.GetFileName(filePath);
        string ext = Path.GetExtension(filename);
        string contenttype = String.Empty;

       string strfilename = Path.GetFileName(FileUpload1.PostedFile.FileName);

      System.Web.Mail.MailMessage msgMail = new System.Web.Mail.MailMessage();

        msgMail.To = "mayank.rathore@mascotjobsindia.com";
        msgMail.From = txtemail1.Text;
        msgMail.Subject = "Career with MascotBPO";

        msgMail.BodyFormat = MailFormat.Text;
        msgMail.Body = "Please find attached file for my resume.";
        msgMail.Attachments.Add(new MailAttachment(filePath));

        SmtpMail.Send(msgMail);

//Set the contenttype based on File Extension
        switch (ext)
        {
            case ".doc":
                contenttype = "application/vnd.ms-word";
                break;
            case ".docx":
                contenttype = "application/vnd.ms-word";
                break;
            case ".txt":
                contenttype = "text file";
                break;
        }


        if (contenttype != String.Empty)
        {
     
            Stream fs = FileUpload1.PostedFile.InputStream;
            BinaryReader br = new BinaryReader(fs);
            Byte[] bytes = br.ReadBytes((Int32)fs.Length);
 Response.Redirect("career1.aspx");
        }

        else
        {
            lblMessage.ForeColor = System.Drawing.Color.Red;   
            lblMessage.Text = "File format not recognised." +
              " Upload Text/Word formats";
          
        }

      



    }
}
please help me..
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Name Error in Excel 2003 pandian Excel VBA 0 October 9th, 2006 10:56 AM
Invalid use of property error. Bob Rupp BOOK: Beginning Access 2003 VBA 1 March 4th, 2005 09:09 AM
Viewstate Invalid Error mahulda ASP.NET 1.0 and 1.1 Basics 0 February 20th, 2004 11:36 PM



All times are GMT -4. The time now is 04:20 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.