Andy
Mon Sep 08 14:52:19 CDT 2003
Thanks I'll give it a shot.
>-----Original Message-----
>Andy,
>
> I don't know if it is impossible to send to both an
external email
>server and a database, but I can at least give you the
code to send email
>through an external server.
>
><%@ Language=VBScript %>
><%
>dim objNewMail
>set objNewMail = CreateObject("CDO.Message")
>dim iConf
>set iConf = CreateObject("CDO.Configuration")
>dim strName
>dim strEmail
>dim strRecip
>dim strSubject
>dim strMessage
>
>strName = Trim(Request.Form("Name"))
>strEmail = Trim(Request.Form("Email"))
>strMessage = Trim(Request.Form("Comments"))
>
>Select Case Request("Subject")
>Case "Accommodations" strRecip="someone@littleamerica.com"
>Case "Dining" strRecip="someone@littleamerica.com"
>Case "Fitness" strRecip="someone@littleamerica.com"
>Case "Meetings" strRecip="someone@grandamerica.com"
>Case "Website" strRecip="webmaster@littleamerica.com"
>Case "Other" strRecip="someone@littleamerica.com"
>End Select
>
>Select Case Request("Subject")
>Case "Accommodations" strSubject="The Little America
Hotel & Towers:
>Accommodations Comment"
>Case "Dining" strSubject="The Little America Hotel &
Towers: Dining Comment"
>Case "Events" strSubject="The Little America Hotel &
Towers: Fitness and
>Salon Comment"
>Case "General" strSubject="The Little America Hotel &
Towers: Meetings
>Comment"
>Case "Website" strSubject="The Little America Hotel &
Towers: Website
>Comment"
>Case "Other" strSubject="The Little America Hotel &
Towers: Comment"
>End Select
>
>objNewMail.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/confi
>guration/sendusing") = 2
>objNewMail.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/confi
>guration/smtpserver") = "mail.sinclairoil.com"
>objNewMail.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/confi
>guration/smtpserverport") = 25
>objNewMail.Configuration.Fields.Update
>objNewMail.Subject = strSubject
>objNewMail.From = "webmaster@sinclairoil.com"
>objNewMail.ReplyTo = strEmail
>objNewMail.To = strRecip
>objNewMail.HTMLBody = "<font face='Times New Roman'
size='2'>" + strMessage
>+ "<br><br>From: " + strName + "<br>" + strEmail
>objNewMail.Send
>set objMail = Nothing
>Set iConf = Nothing
>Set Flds = Nothing
>%>
>
>Best of luck to ya,
>
>
>Roy
>
>
>"Andy" <andyb@airlink.com> wrote in message
>news:4af001c37634$adf7eff0$a401280a@phx.gbl...
>> I have a web and database set up on our SQL server and
>> it's working fine. However, I'd like to add a new page
>> that sends form data to the database and to e-mail at
the
>> same time. I'm using CDONTS in trying to accompish this.
>> The problem is I'm getting this error when submitting
the
>> form:
>>
>> Microsoft VBScript runtime error '800a0046'
>>
>> Permission denied
>>
>> /Production1.asp, line 108
>>
>> The powers that be that control the SQL server say that
>> this is due to no e-mail being set up on that server.
They
>> don't want to set it up either it sounds like because of
>> security concerns. They suggested that I use an external
>> server such as the company SMTP server for the e-mail
>> part.
>>
>> Of course this presents a real challenge to me because
how
>> do I route e-mail to an external server and submit to
the
>> database at the same time? Is that even possible?
>
>
>.
>