Greetings,
I'm fairly new to asp programming and would like a little help regarding sending email in asp. I have the following code:
<%
Set oMailMessage = Server.CreateObject("CDONTS.NewMail"
'Settings for NewMail object and send'
oMailMessage.from = "messagecenter@def.com"
oMailMessage.to = "abc@def.com"
oMailMessage.Importance = 2
oMailMessage.bodyFormat = 1
oMailMessage.MailFormat = 0
oMailMessage.subject = "Firm Notification: Draft Message"
sMessage = "This is a Draft Message. " & vbcrlf & vbcrlf
sMessage = sMessage & "Name: " & vbcrlf & vbcrlf
sMessage = sMessage & "Email: " & vbcrlf & vbcrlf
sMessage = sMessage & "Thank you"
oMailMessage.body = sMessage
oMailMessage.Send()
Set oMailMessage = Nothing
%>
My question is, how do I incorporate this code into a function which can be called by an HTML button object something like this:
<input type="button" value="Send Email" onclick="sendMail()">
Your help is appreciated.
Sincerely,
JD
I'm fairly new to asp programming and would like a little help regarding sending email in asp. I have the following code:
<%
Set oMailMessage = Server.CreateObject("CDONTS.NewMail"
'Settings for NewMail object and send'
oMailMessage.from = "messagecenter@def.com"
oMailMessage.to = "abc@def.com"
oMailMessage.Importance = 2
oMailMessage.bodyFormat = 1
oMailMessage.MailFormat = 0
oMailMessage.subject = "Firm Notification: Draft Message"
sMessage = "This is a Draft Message. " & vbcrlf & vbcrlf
sMessage = sMessage & "Name: " & vbcrlf & vbcrlf
sMessage = sMessage & "Email: " & vbcrlf & vbcrlf
sMessage = sMessage & "Thank you"
oMailMessage.body = sMessage
oMailMessage.Send()
Set oMailMessage = Nothing
%>
My question is, how do I incorporate this code into a function which can be called by an HTML button object something like this:
<input type="button" value="Send Email" onclick="sendMail()">
Your help is appreciated.
Sincerely,
JD