Click to See Complete Forum and Search --> : Email from IE and Netscape
artsapimp
Aug 30th, 2000, 07:32 PM
What I'm trying to do is have an email sent to someone once they have been selected from a dropdown box. Let me explain a little better.
I have a form that is used in an intranet enviornment to track unhappy customers that need to be contacted. Once the form is filled out one of 7 people are chosen to call this customer back. The user only has the choice of sending it to a QUEUE which automatically assigned the person last used to take control of this one.
What I need is for an email to be sent to the person picked using CDONTS just to notify him/her there is work to be done.
Any help would be great. Please reply if I didn't explain it clearly, I will try to answer any questions ASAP.
Ok, this code isn't exactly customized for you, but it's quite easy to modify. :)
<%@ language=VBScript %>
<%
' Declare a CDONTS mail component to send emails
Dim objMailer
' Reference the Mailer object variable to an instance of "CDONTS.Newmail"
Set objMailer = Server.CreateObject("CDONTS.Newmail")
' Construct the email
objMailer.To = "Liron.Leybovich@Ness.com" 'Fillin the TO email address...
objMailer.From = "Your Website" ' ...the FROM email address...
objMailer.Subject = Request("subject") ' ...the subject...
objMailer.BodyFormat = 1 ' 0=HTML, 1=Plain Text
objMailer.MailFormat = 1 ' 0=HTML, 1=Plain Text
objMailer.Body = Request("txt")
' Send the email and dismiss the mailer object
objMailer.Send
Set objMailer = Nothing
' Send confirmation to user %>
<html>
<head>
<title>Thank you</title>
</head>
<body>
<h3>Thank you.</h3>
I shall review your comments.
</body>
</html>
artsapimp
Aug 31st, 2000, 09:32 AM
Thank you very much for the reply, but I did find a few issues I will have with it.
I need to have it compatible with IE and NN, so VBScript isn<font color="#007F00">'t an option for me.
</font>
You know what? <font color="#00007F">While</font> looking at your code I figured all of it out. <font color="#00007F">Let</font> me explain and someone please tell me if I<font color="#007F00">'m crazy or if this really is this easy?
</font>
<font color="#00007F">On</font> the submit.asp an if statement will be there like this...
if Request.Form("AssignedTo") = 'dontemail<font color="#007F00">' Then
</font> ""
<font color="#00007F">Else</font>
<font color="#00007F">Dim</font> objMailer
<font color="#007F00"> ' Reference the Mailer object variable to an instance of "CDONTS.Newmail"
</font> <font color="#00007F">Set</font> objMailer = Server.<font color="#00007F">CreateObject</font>("CDONTS.Newmail")
<font color="#007F00"> ' Construct the email
</font> objMailer.<font color="#00007F">To</font> = "Liron.Leybovich@Ness.com" <font color="#007F00">'Fillin the TO email address...
</font> objMailer.From = "Your Website" <font color="#007F00">' ...the FROM email address...
</font> objMailer.Subject = Request("subject") <font color="#007F00">' ...the subject...
</font> objMailer.BodyFormat = 1 <font color="#007F00">' 0=HTML, 1=Plain Text
</font> objMailer.MailFormat = 1 <font color="#007F00">' 0=HTML, 1=Plain Text
</font> objMailer.Body = Request("txt")
<font color="#007F00"> ' Send the email and dismiss the mailer object
</font> objMailer.Send
<font color="#00007F">Set</font> objMailer = Nothing
End If
Will that work? For some people I don't need to email them, the others will need to have an email.
I would be setting up the email addresses earlier so it will be sent to a variable instead of a static address.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.