Trouble with sending email from form....

Discussion in 'Classic ASP' started by ats, Jan 9, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. ats

    ats

    I thought Discount ASP had ASPMail installed....tried using it and it didn't work.

    I tried using the code for CDO from the "Sample Code Section" and that didn't work either....

    Do I need to configure my site in some way?

    Please help.....

    Also, can I just use "localhost" for my smtp server in the code or do I need to write "smtp.myserver.com"

    Cheers!
    ats
     
  2. Whats the exact error message?
    You can specify just "localhost" as your smtp server

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. ats

    ats

    Huh...this is weird....if I use the PERSIST code it works.

    Not sure why CDO isn't working....I just took the sample code on your KB and used that.

    Damn IE7 won't show me the error messages....

    ats
     
  4. ASPMail has been deprecated from our servers due to lack of support from the vendor.
    Can you give us the exact URL and file name. Try pasting the code on this thread so we can also review it for you. To the best of my knowledge CDO and CDOSYS does work on our servers without any modifications to the customers account. The only thing is that Microsoft does support CDONTS, so we don't have that on our servers anymore.
     
  5. I just got my new temporary website last night. I changed my internal eMail sending routine to utilize cdosys instead of cdonts.


    I get this error message: The "SendUsing" configuration value is invalid.


    when I attempt to send. Here's the code I am using. It doesn't look bad so I'm not sure what's wrong:


    Function EmailCDOSYS ( strAuthorEmail, strRecipientEmail, strCC, strSubject, strBody, intMailFormat, strAttachmentPath, intPriority )
    Dim MyMail
    Set MyMail = Server.CreateObject ( "CDO.Message" )



    MyMail.From = strAuthorEmail
    MyMail.To = strRecipientEmail



    if not isBlank ( strCC ) then MyMail.Cc = strCC


    MyMail.Subject = strSubject


    if intMailFormat = conformatTEXT then
    ' in CDONTS: MyMail.Body =
    ' in CDONTS: MyMail.BodyFormat = 0
    ' MyMail.MailFormat = 1
    MyMail.TextBody = strBody
    else
    ' in CDONTS: MyMail.BodyFormat = 1
    ' MyMail.MailFormat = 0
    MyMail.HTMLBody = strBody
    end if



    ' in CDONTS: MyMail.Importance = intPriority
    ' MyMail.Fields ("urn:schemas:httpmail:importance").Value = intPriority;



    MyMail.Fields.Update()


    MyMail.Send ()


    Set MyMail = Nothing


    EmailCDOSYS = 1
    end function

    Note: the line ' MyMail.Fields ("urn:schemas:httpmail:importance").Value = intPriority;
    had to be comment out because I got an error with the 'intPriority' reference.

    Thkis is my first time using cdosys. I tried making cross-references to cdonts (you can see my "in CDONTS" comments so I wouldn't leave any stone unturned but it doesn't work.

    Also, anyone know what component to use to handle attachments? I used to use a dll that handled the extraction, etc. but now need something else.

    Thanks,
    Paul
     
  6. I just ran some codethat found ASPEMail, CDOSYS, JMail 3 and JMail 4 installed.


    In your code above you're setting the priority after the object is destroyed.


    There are several CDOSYS examples here: http://www.w3schools.com/asp/asp_send_email.asp
     
  7. I don't see the object being destroyed until after the send() method. The attempt to set the priority byte is done prior to the update() which is done prior to the send() and the the object is set to nothing.


    Where did you see otherwise??


    Thanks,


    paul
     
  8. Looking at the function declaring EmailCDOSYS = 1 back to the function itself seems a bit odd...


    But I have to admit I looked at it rather quickly and at first thought it was part of intPriority. [​IMG]
     
  9. Actually, you made me look at a little closer and I spotted the error! This is an asp document and there is a ; after the assignment of intPriority!


    That's what I get for copying code snipplets (sic) blindly!


    Thanks,


    Paul
     
  10. I just had Espresso #4 and was right there with you this time. [​IMG]


    btw, my middle name is Paul. (Mark Paul Wisecarver aka wisemx)
     
  11. Mark,


    You sent me to the W3SCHOOLS site for CDOSYS and I discovered something that I might be lacking in my eMail routine. Do I have to treat the Discount ASP site as a remote Server? If so, then what values do I have to put where the W3SCHOOLS site says to put:


    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
    'Name or IP of remote SMTP server
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    ="smtp.server.com"
    'Server port
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
    =25
    myMail.Configuration.Fields.Update



    prior to issuing the Send() method?





    Thanks,


    Paul
     
  12. It's pretty bad when you reply three times to your own replies before anybody else has a chance to!!


    I Googled the error I am getting ( "The "SendUsing" configuration value is invalid." ) and one of the replies to someone was: "You may need to set the SMTP server explicitly. I believe it defaults to localhost (that's why it works on your local machine). Apparently, the server your page runs on does not have an SMTP server installed"
    So, is my problem related to the fact that I am using a temporary URL and SMTP server isnd't accessable to me yet?

    Or do I have explicitely fill in the Configuration.Field.Items()??

    Thanks,
    Paul
     
  13. For DASP accounts use localhost for this and ASP.NET 2.0 mail.

    There are POP and SMTP components we can use here but for code like this it's localhost you need.
    Even if it's for something like ASP forums, the email server will still be localhost.
     
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