Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

turboibest

No que estou errando

Recommended Posts

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 variablesDim nCardId, sNameTo, sNameFrom, sEmailFrom, sText, sBGColor, sTextColor, sEmailToDim sOtherIdFunction 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-9Const szDefault = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"Dim nCountDim sRetDim nNumberDim nLengthRandomize 'init random If sValidChars = "" ThensValidChars = szDefault  End IfnLength = Len( sValidChars )For nCount = 1 To nNoCharsnNumber = Int((nLength * Rnd) + 1)sRet = sRet & Mid( sValidChars, nNumber, 1 )NextPassword_GenPass = sRet End FunctionnCardId = Request.Form("fldAuto")if nCardId = "" ThenResponse.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 databaseDim oRSSet oConn = PostCard_GetDatabaseConn()oConn.Execute "update " & Postcard_GetTablePrefix() & "card set sendcount=sendcount+1 where fldAuto=" & nCardIdSet oRS = Server.CreateObject("ADODB.Recordset")If Postcard_GetDatabaseType() = "Access" ThenoRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenKeyset,adLockOptimisticElseoRS.CursorLocation = adUseClientoRS.Open "select fldAuto, cardid, nameto, namefrom, emailto, emailfrom, greeting, otherid, bgcolor, textcolor, stext from " & Postcard_GetTablePrefix() & "createdpostcards where fldAuto=-1 " ,oConn ,adOpenDynamic,adLockOptimisticEnd If oRS.AddNewoRS("cardid") = nCardIdoRS("nameto") = sNameTooRS("namefrom") = sNameFromoRS("emailto") = sEmailTooRS("emailfrom") = sEmailFromoRS("greeting") = sGreetingoRS("stext") = sTextoRS("bgcolor") = sBGColoroRS("textcolor") = sTextcolorsOtherId = Password_GenPass( 10, "" )oRS("otherid")= sOtherIdoRS.UpdateDim IDToSendIDToSend = sOtherId & oRS("fldAuto").ValueoRS.CloseSet oRS = NothingoConn.CloseSet oConn = NothingstrMsgHeader = sNameFrom & "(" & sEmailFrom & ")" & " has sent you a postcard!" & vbCrLf strMsgHeader = "The address to pick it up is : " & GetPathToPickupScript() & "?cardid=" & IDToSendstrMsgFooter = 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 abaixosErr = 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.Endelse   ' 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

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.