Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Mail Problems, please help


Message #1 by Charles Kline <ckline@r...> on Thu, 01 Aug 2002 13:24:59 -0400
For some reason this code is not sending mail. I don't get any error either.
Win 2k. Please I could use some help with this.

Code follows:
<%

Dim objCDOMail 'The CDO object


'###############################################################
'##      Change you@y... to your email address      ##
'###############################################################
strTo = "you@y... "

'###############################################################
'##      We can make the subject dynamic if you want          ##
'##      or you can just replace text inside "" to anything   ##
'###############################################################
strSubject = "Email from website"


strBody = "Current date: " & date()
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "I am...: "
strBody = strBody & Request.Form("who")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "My name is: "
strBody = strBody & Request.Form("myName")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "My email address is: "
strBody = strBody & Request.Form("myEmail")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "File Number: "
strBody = strBody & Request.Form("fileNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Document Number: "
strBody = strBody & Request.Form("docNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "First Name: "
strBody = strBody & Request.Form("fName") & " "
strBody = strBody & Request.Form("lName") & ", "
strBody = strBody & Request.Form("mName") & " "
strBody = strBody & Request.Form("generation")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "House #: "
strBody = strBody & Request.Form("houseNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Direction: "
strBody = strBody & Request.Form("direction")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Street Name: "
strBody = strBody & Request.Form("streetName") & " "
strBody = strBody & Request.Form("streetType")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "City: "
strBody = strBody & Request.Form("city")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "State: "
strBody = strBody & Request.Form("state")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Zip Code: "
strBody = strBody & Request.Form("zip")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "SSN: "
strBody = strBody & Request.Form("ssn1") & "-" & Request.Form("ssn2") & "-"
& Request.Form("ssn3")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "DOB: "
strBody = strBody & Request.Form("dob1") & "/" & Request.Form("dob2") & "/"
& Request.Form("dob3")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Drivers Lic. #: "
strBody = strBody & Request.Form("drvLicNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Previous Address: "
strBody = strBody & Request.Form("prevAddr") & chr(10)



Set objCDOMail = Server.CreateObject("CDONTS.Newmail")

'###############################################################
'##  Change yourname to reflect where the email is sent from  ##
'###############################################################
objCDOMail.From = "yourname"
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody
objCDOMail.Send
Set objCDOMail = Nothing
%>


-------------------------------------------------
Charles Kline        email: ckline@r...
President            phone:  xxx.xxx.xxxx


RightCode, Inc.
900 Briggs Road, Suite 303
Mt. Laurel, NJ 08054


http://www.rightcode.net  -= fuel for websites =-

Message #2 by "Darrell" <darrell@b...> on Thu, 1 Aug 2002 19:29:47 +0100
Hi Charles

I also got stuck with this one some time ago and  discovered that my mail
server was refusing any mail with an invalid e-mail address.  Make sure that
objCDOMail.From has a valid e-mail address assigned to it.

Cheers
Darrell

-----Original Message-----
From: Charles Kline [mailto:ckline@r...]
Sent: 01 August 2002 18:25
To: Access ASP
Subject: [access_asp] Mail Problems, please help


For some reason this code is not sending mail. I don't get any error either.
Win 2k. Please I could use some help with this.

Code follows:
<%

Dim objCDOMail 'The CDO object


'###############################################################
'##      Change you@y... to your email address      ##
'###############################################################
strTo = "you@y... "

'###############################################################
'##      We can make the subject dynamic if you want          ##
'##      or you can just replace text inside "" to anything   ##
'###############################################################
strSubject = "Email from website"


strBody = "Current date: " & date()
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "I am...: "
strBody = strBody & Request.Form("who")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "My name is: "
strBody = strBody & Request.Form("myName")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "My email address is: "
strBody = strBody & Request.Form("myEmail")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "File Number: "
strBody = strBody & Request.Form("fileNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Document Number: "
strBody = strBody & Request.Form("docNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "First Name: "
strBody = strBody & Request.Form("fName") & " "
strBody = strBody & Request.Form("lName") & ", "
strBody = strBody & Request.Form("mName") & " "
strBody = strBody & Request.Form("generation")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "House #: "
strBody = strBody & Request.Form("houseNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Direction: "
strBody = strBody & Request.Form("direction")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Street Name: "
strBody = strBody & Request.Form("streetName") & " "
strBody = strBody & Request.Form("streetType")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "City: "
strBody = strBody & Request.Form("city")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "State: "
strBody = strBody & Request.Form("state")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Zip Code: "
strBody = strBody & Request.Form("zip")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "SSN: "
strBody = strBody & Request.Form("ssn1") & "-" & Request.Form("ssn2") & "-"
& Request.Form("ssn3")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "DOB: "
strBody = strBody & Request.Form("dob1") & "/" & Request.Form("dob2") & "/"
& Request.Form("dob3")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Drivers Lic. #: "
strBody = strBody & Request.Form("drvLicNum")
strBody = strBody & vbCrLf
strBody = strBody & vbCrLf
strBody = strBody & "Previous Address: "
strBody = strBody & Request.Form("prevAddr") & chr(10)



Set objCDOMail = Server.CreateObject("CDONTS.Newmail")

'###############################################################
'##  Change yourname to reflect where the email is sent from  ##
'###############################################################
objCDOMail.From = "yourname"
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody
objCDOMail.Send
Set objCDOMail = Nothing
%>


-------------------------------------------------
Charles Kline        email: ckline@r...
President            phone:  xxx.xxx.xxxx


RightCode, Inc.
900 Briggs Road, Suite 303
Mt. Laurel, NJ 08054


http://www.rightcode.net  -= fuel for websites =-




  Return to Index