Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: Emailing a form

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Emailing a form

    How do you email the data submited by a form. I checked asp101.com but their tutorial script would error out on my machine.
    Thanks

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check out:

    http://www.aspfaqs.com/aspfaqs/ShowC...y.asp?CatID=10

    If your host can send using CDONTS, I often use this blank template to create my emails:

    Set objMail = Server.CreateObject("CDONTS.NewMail")
    objMail.To = ""
    objMail.From = ""
    objMail.cc = ""
    objMail.bcc = ""
    'objMail.mailFormat = 0 'This is for HTML
    'objMail.bodyFormat = 0 'This is for HTML

    MessageBody = "" & CHR(13)
    MessageBody = MessageBody & "" & CHR(13)

    objMail.Subject = ""
    objMail.Body = MessageBody
    objMail.Send
    Set objMail = Nothing
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My problem is that i'm running IIS on a different server than the exchange box. How do you connect the 2 together to send an email. I get an error message of Error Type:
    Server object, ASP 0177 (0x800401F3)
    Invalid class string
    How can I get this to work
    Thanks

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure what you mean by "Exchange Box"... I've always sent emails directly from my applications to this point... anyone?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    First off, do you have an SMTP server running?
    If not, install one. IIS 5.0 comes with one on the windows 2000 CD.

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm actually running the webserver on my windows xp box. I do have smtp running on the XP box. I get the error at this line
    Set objMail = Server.CreateObject("CDONTS.NewMail")
    Does windows XP come with CDONTS?

  • #7
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    If you have an SMTP then you should have no problems..

    I want you to take this exact and save it as mail.asp in your wwwroot folder... then open it up like
    http://YOURIP/mail.asp


    mail.asp
    Code:
    <%@ Language=VBScript %>
    <% Option Explicit %>
    <%
    	Dim mailObj
    	Set mailObj = CreateObject("CDONTS.NewMail")
    	With mailObj
    		.BodyFormat = 1 ' 1=Text, 0=HTML
    		.MailFormat = 1 ' 1=Text, 0=MIME
    		.Importance = 1 ' 0=Low, 1=Normal, 2=High
    		.To = YOUREMAIL
    		.Cc = ""
    		.Bcc = ""
    		.Subject = "Your e-mailing system works!"
    		.Body = "Your E-mailing system now works!" & vbcrlf & "Your Welcome" & vbcrlf & vbcrlf & "~Alex Robson"
    		.Send
    	End With
    	Set mailObj = Nothing
    %>

  • #8
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried what you said.
    I get this error now.
    Error Type:
    Microsoft VBScript runtime (0x800A01AD)
    ActiveX component can't create object: 'CDONTS.NewMail'
    /mail.asp, line 5

    I check to see if snmp was running. It was. I stopped it, started it and ran the script again. Still same error message.
    Any other ideas?
    Thank you

  • #9
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    I want you to fill me in on some information.

    What version of windows are you running?
    What version of IIS are you running?
    Do you use any HTML or ASP writing programs to help you with ASP or HTML code? (Example: Dreamweaver)


    What I think the error is telling you, is that you don't have cdonts. But after you give me this information, I can help you fix that problem!

  • #10
    New Coder
    Join Date
    Jun 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Maybe you should try this.

    I remember, I read a artical about it.
    CDNTNS means "Collaboration data objects for NT server", in NT server, it is CDO 1.X, and after update to windows 2000, it will be updated to cdo 2.0. when you update your server, CDO 1.x will not be replaced, and you can use both cdo 1.x and cdo 2.0 object.

    But when you install windows2000 directly , CDO1.x will not be installed, (only cdo 2.0). in cdo 2.0 you cannot use "newmail", you must use "message". I think you can find it in microsoft website.

    http://www.microsoft.com/MSPress/boo...pchap/3449.asp


    Sorry, I did Not try it. But just a idea. I hope it is helpful for you.

    Good luck

  • #11
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am using windows xp for my os, and I'm running version 5.1 of IIS. Does CDONTS come installed on XP? Am I better off running IIS on a NT2000 machine?
    If I don't have CDONTS installed where do I get the download from?
    I am using UltraEdit as my text editor. Its kinda like notepad.

  • #12
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    5.1 eh?
    Ok, do this: Reinstall SMTP and re update your hotfix. (hotfix is a security thing, it should auto update on xp (I beleive))
    If that doesn't work, I can get you a mail component that will work just fine.

  • #13
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I uninstalled smtp but now when I install it again it wants a whistler profession cd. What is that. I don't have that disk. It needs that file inorder to install smtp. Now what?

  • #14
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    What do you mean it needs another cd?
    So you have a virus scanner? Scan your system for anything.

    What XP version do you have? HOME, PRO, SERVER?

    This is strange. If this is a dedicated computer for the web servers, you might want to go with windows 2000 pro, or windows 2000 server.
    If you don't mind, just try reinstalling the OS you have now and see how the smtp was installed before, without the other cd.


    Btw, is your copy of windows xp a ware? If it is, maybe you are missing that cd because of that reason, or something is wrong when you installed the OS.


    I don't see how you can have the smtp server at all, without the cd in the first place.

  • #15
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have XP Professional. I do have a lagit copy of XP. The only thing I can think of is that I have installed a bunch of updates off of microsofts.update website and some how it updated the smtp server that now when I try to reinstall it, its asking for something it updated off of a whistler professional cd.
    I will mess around with it and see if I can get it installed again.
    I do plan in the future to move the web server onto a windows 2000 server out the .net server.
    I'm sure I will have many questions on CDONTS
    Thanks for your help =)


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •