Im using ASP with VBScript.
At some point of the code of the application that Im making some changes, I need to get a confirmation from the user if he wants or not to send a confirmation e-mail for the action he performed.
Its simple, like this:
Expand|Select|Wrap|Line Numbers
- sendEmail = MsgBox("Send e-mail?",5,"Confirmation")
- if sendEmail = 6 then
- Set objmail = Server.CreateObject("CDONTS.NewMail")
- objmail.from = trim(rs("EMAIL"))
- objmail.Value("Reply-To") = trim(rs("EMAIL"))
- objmail.to = trim(rs("EMAIL_RESPONSAVEL"))&";"&trim(rs("EMAIL_GRUPO"))
- objmail.subject = trim(rs("EMAIL_ASSUNTO_FECHAMENTO_RESPONSAVEL"))&" "&trim(rs("NOME_TIPO_DOCUMENTO"))
- objmail.body = texto
- objmail.BodyFormat = 0
- objmail.Importance = 2
- objmail.MailFormat = 0
- objmail.send
- set objmail = nothing
- end if
The thing is like this, I get the old Permission Denied error..
So I tryed like that, that I dont know is its going to work or not until someone uses this part of the application:
Expand|Select|Wrap|Line Numbers
- <SCRIPT language="VBScript">
- sendEmail = MsgBox("Send e-mail?",5,"Confirmation")
- if sendEmail = 6 then
- send = true
- end if
- </SCRIPT>
- <%
- if send = true
- Set objmail = Server.CreateObject("CDONTS.NewMail")
- objmail.from = trim(rs("EMAIL"))
- objmail.Value("Reply-To") = trim(rs("EMAIL"))
- objmail.to = trim(rs("EMAIL_RESPONSAVEL"))&";"&trim(rs("EMAIL_GRUPO"))
- objmail.subject = trim(rs("EMAIL_ASSUNTO_FECHAMENTO_RESPONSAVEL"))&" "&trim(rs("NOME_TIPO_DOCUMENTO"))
- objmail.body = texto
- objmail.BodyFormat = 0
- objmail.Importance = 2
- objmail.MailFormat = 0
- objmail.send
- set objmail = nothing
- end if
- %>
Anyone know some way to get this working?
Thank you very much in advance!