Hello everyone,
I'm fairly new to .asp and am having a bit of trouble with the following task. I have a page that sends an email out to a group of people within the organization using CDONTs and it functions, somewhat. I want the email to be sent when the form is submitted, currently the code executes as soon as the page loads. Here is the code, I just need to know how to make it execute onSubmit rather then whent he page loads.
<%
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
myMail.From = "User" & " <" & "user@mycomp.com" & ">"
myMail.To = "me@mycomp.com"
myMail.BCC = Request("hfEmail")
myMail.Subject = "Reminder"
myMail.BodyFormat = 0
myMail.Body = "Body"
myMail.MailFormat = 0
On error resume next
myMail.Send
Set objMail = nothing
End If
%>
Any help would be appreciated!
J
I'm fairly new to .asp and am having a bit of trouble with the following task. I have a page that sends an email out to a group of people within the organization using CDONTs and it functions, somewhat. I want the email to be sent when the form is submitted, currently the code executes as soon as the page loads. Here is the code, I just need to know how to make it execute onSubmit rather then whent he page loads.
<%
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
myMail.From = "User" & " <" & "user@mycomp.com" & ">"
myMail.To = "me@mycomp.com"
myMail.BCC = Request("hfEmail")
myMail.Subject = "Reminder"
myMail.BodyFormat = 0
myMail.Body = "Body"
myMail.MailFormat = 0
On error resume next
myMail.Send
Set objMail = nothing
End If
%>
Any help would be appreciated!
J