Estou personalizando um script de cartão virtual e consigo fazer tudo, mais na hora que clico para enviar o cartão ele aparece o erro abaixo:
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'SendEmail'
/1.1/site/cards/sendit.asp, line 86
ai vai o arquivo que está sendo citado acima:
<!--#include file="inccard.asp"-->
<!--#include file="incgenmail.asp"-->
<%
' First of all lets just get all variables
Dim nCardId, sNameTo, sNameFrom, sEmailFrom, sText, sBGColor, sTextColor, sEmailTo
Dim sOtherId
Function Password_GenPass( nNoChars, sValidChars )
' nNoChars = length of generated password
' sValidChars = valid characters. If zerolength-string
' default is used: A-Z AND a-z AND 0-9
Const szDefault = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"
Dim nCount
Dim sRet
Dim nNumber
Dim nLength
Randomize 'init random
If sValidChars = "" Then
sValidChars = szDefault
End If
nLength = Len( sValidChars )
For nCount = 1 To nNoChars
nNumber = Int((nLength * Rnd) + 1)
sRet = sRet & Mid( sValidChars, nNumber, 1 )
Next
Password_GenPass = sRet
End Function
nCardId = Request.Form("fldAuto")
if nCardId = "" Then
Response.Redirect "."
End If
'Ok...
sNameTo = Request.Form("nameto")
sNameFrom = Request.Form("namefrom")
sEmailFrom = Request.Form("emailfrom")
sEmailTo = Request.Form("emailto")
sGreeting = Request.Form("greeting")
sText = Request.Form("S1")
sBGColor = Request.Form("BgColor")
sTextColor = Request.Form("TColor")
'Save it to database
Dim oRS
Set oConn = PostCard_GetDatabaseConn()
oConn.Execute "update " & Postcard_GetTablePrefix() & "card set sendcount=sendcount+1 where fldAuto=" & nCardId
Set oRS = Server.CreateObject("ADODB.Recordset")
If Postcard_GetDatabaseType() = "Access" Then
oRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenKeyset,adLockOptimistic
Else
oRS.CursorLocation = adUseClient
oRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenDynamic,adLockOptimistic
End If
oRS.AddNew
oRS("cardid") = nCardId
oRS("nameto") = sNameTo
oRS("namefrom") = sNameFrom
oRS("emailto") = sEmailTo
oRS("emailfrom") = sEmailFrom
oRS("greeting") = sGreeting
oRS("stext") = sText
oRS("bgcolor") = sBGColor
oRS("textcolor") = sTextcolor
sOtherId = Password_GenPass( 10, "" )
oRS("otherid")= sOtherId
oRS.Update
Dim IDToSend
IDToSend = sOtherId & oRS("fldAuto").Value
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
strMsgHeader = sNameFrom & "(" & sEmailFrom & ")" & " has sent you a postcard!" & vbCrLf
strMsgHeader = "The address to pick it up is : " & GetPathToPickupScript() & "?cardid=" & IDToSend
strMsgFooter = vbCrLf & vbCrLf & "This card was sent and created with the postcardservice at http://www.aspcode.net"
Dim sErr
'A linha que está com erro é essa abaixo
sErr = SendEmail( Postcard_GetmailServer(), Postcard_GetmailFrom(), CStr(sEmailTo), sNameFrom & " has sent you a postcard", strMsgHeader & strMsgFooter )
If sErr = "" Then
Response.Redirect "thanks.asp"
Response.Flush
Response.End
else
' Message send failure
Response.Write ("An error has occurred.<BR>")
' Send error message
Response.Write ("The error was " & sErr)
End If
%>
O componente que estou usando para o envio dos cartões é o CDONTS
ai vai o arquivo de configuração do componente:
incgenmail.asp
<%
Function SendEmail(sFromEmail, sToEmail, sSubject, sText )
Dim objMail
set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = sFromEmail
objMail.To = sToEmail
objMail.Subject = sSubject
objMail.Body = sText
objMail.MailFormat = 0
objMail.BodyFormat = 0
objMail.Send
Set objMail = nothing
End Function
%>
se puderem me ajudareu agradeço, obrigado pela atenção
Pergunta
turboibest
Estou personalizando um script de cartão virtual e consigo fazer tudo, mais na hora que clico para enviar o cartão ele aparece o erro abaixo:
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'SendEmail'
/1.1/site/cards/sendit.asp, line 86
ai vai o arquivo que está sendo citado acima:
<!--#include file="inccard.asp"--> <!--#include file="incgenmail.asp"--> <% ' First of all lets just get all variables Dim nCardId, sNameTo, sNameFrom, sEmailFrom, sText, sBGColor, sTextColor, sEmailTo Dim sOtherId Function Password_GenPass( nNoChars, sValidChars ) ' nNoChars = length of generated password ' sValidChars = valid characters. If zerolength-string ' default is used: A-Z AND a-z AND 0-9 Const szDefault = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789" Dim nCount Dim sRet Dim nNumber Dim nLength Randomize 'init random If sValidChars = "" Then sValidChars = szDefault End If nLength = Len( sValidChars ) For nCount = 1 To nNoChars nNumber = Int((nLength * Rnd) + 1) sRet = sRet & Mid( sValidChars, nNumber, 1 ) Next Password_GenPass = sRet End Function nCardId = Request.Form("fldAuto") if nCardId = "" Then Response.Redirect "." End If 'Ok... sNameTo = Request.Form("nameto") sNameFrom = Request.Form("namefrom") sEmailFrom = Request.Form("emailfrom") sEmailTo = Request.Form("emailto") sGreeting = Request.Form("greeting") sText = Request.Form("S1") sBGColor = Request.Form("BgColor") sTextColor = Request.Form("TColor") 'Save it to database Dim oRS Set oConn = PostCard_GetDatabaseConn() oConn.Execute "update " & Postcard_GetTablePrefix() & "card set sendcount=sendcount+1 where fldAuto=" & nCardId Set oRS = Server.CreateObject("ADODB.Recordset") If Postcard_GetDatabaseType() = "Access" Then oRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenKeyset,adLockOptimistic Else oRS.CursorLocation = adUseClient oRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenDynamic,adLockOptimistic End If oRS.AddNew oRS("cardid") = nCardId oRS("nameto") = sNameTo oRS("namefrom") = sNameFrom oRS("emailto") = sEmailTo oRS("emailfrom") = sEmailFrom oRS("greeting") = sGreeting oRS("stext") = sText oRS("bgcolor") = sBGColor oRS("textcolor") = sTextcolor sOtherId = Password_GenPass( 10, "" ) oRS("otherid")= sOtherId oRS.Update Dim IDToSend IDToSend = sOtherId & oRS("fldAuto").Value oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing strMsgHeader = sNameFrom & "(" & sEmailFrom & ")" & " has sent you a postcard!" & vbCrLf strMsgHeader = "The address to pick it up is : " & GetPathToPickupScript() & "?cardid=" & IDToSend strMsgFooter = vbCrLf & vbCrLf & "This card was sent and created with the postcardservice at http://www.aspcode.net" Dim sErr 'A linha que está com erro é essa abaixo sErr = SendEmail( Postcard_GetmailServer(), Postcard_GetmailFrom(), CStr(sEmailTo), sNameFrom & " has sent you a postcard", strMsgHeader & strMsgFooter ) If sErr = "" Then Response.Redirect "thanks.asp" Response.Flush Response.End else ' Message send failure Response.Write ("An error has occurred.<BR>") ' Send error message Response.Write ("The error was " & sErr) End If %>O componente que estou usando para o envio dos cartões é o CDONTS ai vai o arquivo de configuração do componente: incgenmail.asp<% Function SendEmail(sFromEmail, sToEmail, sSubject, sText ) Dim objMail set objMail = Server.CreateObject("CDONTS.NewMail") objMail.From = sFromEmail objMail.To = sToEmail objMail.Subject = sSubject objMail.Body = sText objMail.MailFormat = 0 objMail.BodyFormat = 0 objMail.Send Set objMail = nothing End Function %>se puderem me ajudareu agradeço, obrigado pela atenção
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.