charon
11-21-2002, 02:44 AM
hi,
I wonder why once I call two Subroutine, the mail object failed to send the email, for instance:
AutoRespond place, fphone, emailTo, sender, subject
AutoNotify emailCopy, uName, place, Notes, sender, subject
if I call only one subroutine (AutoRespond/AutoNotify), it be able to function properly. May I know why???
below is my mail subroutine:
<%
SUB sendMail( fromWho, toWho, Body, Rcheck, subject )
Dim myMail
'Body = Replace(Body, VBCrLf, "<br>")
Body = Replace(Body,Chr(13),"<br>")
SET myMail = Server.CreateObject("CDONTS.NewMail")
myMail.MailFormat = 0
myMail.BodyFormat = 0
myMail.To = toWho
myMail.From = fromWho
'myMail.Bcc = toWho
myMail.Subject = subject
myMail.Body = Body
If Rcheck <> "" Then
myMail.Cc = fromWho
End If
myMail.Send
SET myMail = Nothing
If Redirect <> "" Then
Response.Redirect Redirect
Else
Response.Write "Your mail has been sent."
End If
END SUB
Sub AutoRespond(place, tel, mailto, sender, subject)
Dim Rcheck
msg = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & vbCrLf & _
"Dear Sir/Madam," & vbCrLf & vbCrLf & _
"Thank you for registering at www.setiahomes.com" & vbCrLf & vbCrLf & _
"We are pleased to confirm that your registration for future launches in " & _
place & " has been received." & vbCrLf & vbCrLf & _
"We will keep you informed of the latest developments and invite you to " & _
"the sales launch for the phases you are interested in as the launch " & _
"dates draw nearer." & vbCrLf & vbCrLf & _
"To speak to our sales and marketing representatives, call us at " & _
tel & vbCrLf & vbCrLf & _
"Our offices are open Monday to Friday from 9.00 a.m. to 5.15 p.m. and " & _
"Saturdays from 9.00 a.m. to 4.00 p.m. We are closed on the first " & _
"Saturday of every month." & vbCrLf & vbCrLf & _
"Thank you." & vbCrLf & vbCrLf & _
"The Management of S P Setia Bhd" & vbCrLf & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
If mailto <> "" Then
sendMail sender, mailto, msg, Rcheck, subject
End If
End Sub
Sub AutoNotify(emailcopy, registrant, place, comment, sender, subject)
Dim Rcheck
msg = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & vbCrLf & _
"Dear Our Sales Person," & vbCrLf & _
"This is an email to notify you that " & registrant & vbCrLf & _
"has been registered for the " & place & " futurelauches. " & vbCrLf & _
"Below is " & registrant & " extra notes: " & vbCrLf & Comment & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
If emailcopy <> "" Then
sendMail sender, emailcopy, msg, Rcheck, subject
End If
End Sub
%>
Please help!!!!!
I wonder why once I call two Subroutine, the mail object failed to send the email, for instance:
AutoRespond place, fphone, emailTo, sender, subject
AutoNotify emailCopy, uName, place, Notes, sender, subject
if I call only one subroutine (AutoRespond/AutoNotify), it be able to function properly. May I know why???
below is my mail subroutine:
<%
SUB sendMail( fromWho, toWho, Body, Rcheck, subject )
Dim myMail
'Body = Replace(Body, VBCrLf, "<br>")
Body = Replace(Body,Chr(13),"<br>")
SET myMail = Server.CreateObject("CDONTS.NewMail")
myMail.MailFormat = 0
myMail.BodyFormat = 0
myMail.To = toWho
myMail.From = fromWho
'myMail.Bcc = toWho
myMail.Subject = subject
myMail.Body = Body
If Rcheck <> "" Then
myMail.Cc = fromWho
End If
myMail.Send
SET myMail = Nothing
If Redirect <> "" Then
Response.Redirect Redirect
Else
Response.Write "Your mail has been sent."
End If
END SUB
Sub AutoRespond(place, tel, mailto, sender, subject)
Dim Rcheck
msg = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & vbCrLf & _
"Dear Sir/Madam," & vbCrLf & vbCrLf & _
"Thank you for registering at www.setiahomes.com" & vbCrLf & vbCrLf & _
"We are pleased to confirm that your registration for future launches in " & _
place & " has been received." & vbCrLf & vbCrLf & _
"We will keep you informed of the latest developments and invite you to " & _
"the sales launch for the phases you are interested in as the launch " & _
"dates draw nearer." & vbCrLf & vbCrLf & _
"To speak to our sales and marketing representatives, call us at " & _
tel & vbCrLf & vbCrLf & _
"Our offices are open Monday to Friday from 9.00 a.m. to 5.15 p.m. and " & _
"Saturdays from 9.00 a.m. to 4.00 p.m. We are closed on the first " & _
"Saturday of every month." & vbCrLf & vbCrLf & _
"Thank you." & vbCrLf & vbCrLf & _
"The Management of S P Setia Bhd" & vbCrLf & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
If mailto <> "" Then
sendMail sender, mailto, msg, Rcheck, subject
End If
End Sub
Sub AutoNotify(emailcopy, registrant, place, comment, sender, subject)
Dim Rcheck
msg = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & vbCrLf & _
"Dear Our Sales Person," & vbCrLf & _
"This is an email to notify you that " & registrant & vbCrLf & _
"has been registered for the " & place & " futurelauches. " & vbCrLf & _
"Below is " & registrant & " extra notes: " & vbCrLf & Comment & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbCrLf & _
"Setiahomes.com - Discover The Natural Place to Call Home" & vbCrLf & _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
If emailcopy <> "" Then
sendMail sender, emailcopy, msg, Rcheck, subject
End If
End Sub
%>
Please help!!!!!