Question : Strange CDONTS behavior

The first part of the script sends out an email to the webmaster, the second part sends out an email to the person who filled out the form if they gave an email address.

If I leave the email address blank, i get the first part of the script sending me an email as this is designed to always be sent. If I fill in an email address, i get the second part sending me an email but i get nothing from the first part, when the first part is always supposed to send.

Is it because both emails are to the same address?? that doesn't make sense to me.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Dim objNewMail, objNewMail1
	Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
		objCDOMail.To = "[email protected]"
		objCDOMail.From = "[email protected]"
		txtBody = "Someone has contacted you from your site" & VbCrLf & VbCrLf & "Name: " & name & VbCrLf & VbCrLf & "Phone: " & phone & VbCrLf & VbCrLf & "Email: " & email & VbCrLf & VbCrLf & "Case description: " & descrip 
    objCDOMail.Subject = "Someone has contacted you from your website"
		objCDOMail.Body = txtBody
		objCDOMail.Send
		Set objCDOMail = Nothing		
	If email <> "" Then
		Set objCDOMail1 = Server.CreateObject("CDONTS.NewMail1")
		objCDOMail1.To = email
		objCDOMail1.From = "[email protected]"
		txtBody = "This is an automated response. Please do not reply........has received your message. Thank you for telling us about your case. We will attempt to contact you using the information you have provided. You may also reach us at 1-888 blank during normal business hours or you may leave a message after business hours" & VbCrLf & VbCrLf & VbCrLf & VbCrLf & "You have submitted the following information:" & VbCrLf & VbCrLf & "Name: " & name & VbCrLf & VbCrLf & "Phone: " & phone & VbCrLf & VbCrLf & "Email: " & email & VbCrLf & VbCrLf & "Case description: " & descrip 
    objCDOMail1.Subject = "Your submission has been received"
		objCDOMail1.Body = txtBody
		objCDOMail1.Send
		Set objCDOMail1 = Nothing
	End If

Answer : Strange CDONTS behavior

Hi,

  Do you have a typo on line 11 - ie "CDONTS.NewMail1" rather than "CDONTS.NewMail"
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Dim objNewMail, objNewMail1
	Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
		objCDOMail.To = "[email protected]"
		objCDOMail.From = "[email protected]"
		txtBody = "Someone has contacted you from your site" & VbCrLf & VbCrLf & "Name: " & name & VbCrLf & VbCrLf & "Phone: " & phone & VbCrLf & VbCrLf & "Email: " & email & VbCrLf & VbCrLf & "Case description: " & descrip 
    objCDOMail.Subject = "Someone has contacted you from your website"
		objCDOMail.Body = txtBody
		objCDOMail.Send
		Set objCDOMail = Nothing		
	If email <> "" Then
		Set objCDOMail1 = Server.CreateObject("CDONTS.NewMail")
		objCDOMail1.To = email
		objCDOMail1.From = "[email protected]"
		txtBody = "This is an automated response. Please do not reply........has received your message. Thank you for telling us about your case. We will attempt to contact you using the information you have provided. You may also reach us at 1-888 blank during normal business hours or you may leave a message after business hours" & VbCrLf & VbCrLf & VbCrLf & VbCrLf & "You have submitted the following information:" & VbCrLf & VbCrLf & "Name: " & name & VbCrLf & VbCrLf & "Phone: " & phone & VbCrLf & VbCrLf & "Email: " & email & VbCrLf & VbCrLf & "Case description: " & descrip 
    objCDOMail1.Subject = "Your submission has been received"
		objCDOMail1.Body = txtBody
		objCDOMail1.Send
		Set objCDOMail1 = Nothing
	End If
Random Solutions  
 
programming4us programming4us