View Single Post
  #7 (permalink)  
Old Nov 28th, 2007, 10:28
robbied72 robbied72 is offline
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: ASP Form - email won't process

Quote:
Originally Posted by welshstew View Post
I'm also new to ASP but I'm also a little bit confused as to what the following is doing:
Code: Select all
    Set Email = Server.CreateObject("CDO.Message")
    Set EMailConfig = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
    'Set Flds = EmailConfig.Fields
    
    With EmailConfig.Fields
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'tells cdo we are using the local smtp service
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" 'verify that this path is correct
        .Update 'updates CDOs configuration
    End With
    
    With Email
        .Configuration = EMailConfig
        .From = "Stuff Website"
        .Subject = "Publications Order"
        .TextBody = body
        .To = "myemail@myemail.com"
        .Send
    End With
could you try the following instead of the above and see what happens (ensure you have a backup of the original - I am still learning...)
Code: Select all
' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
Hi Stew,

The object has to be created in order for it to work.
Reply With Quote