Problem calling a sub

Results 1 to 2 of 2

Thread: Problem calling a sub

  1. #1
    Join Date
    Dec 1969

    Default Problem calling a sub

    Greetings, <BR>I created a sub to send mail using the SMTPsvg <BR><BR>The code: <BR>Sub TrilogicalMail(sMailHost,sFromName,sFromAddress,sT oName,sToAddress,sSubject,sAttachment,sMessage) <BR>Set Mailer = Server.CreateObject("SMTPsvg.Mailer") <BR> Mailer.FromName = sFromName <BR> Mailer.FromAddress = sFromAddress <BR> Mailer.RemoteHost = sMailHost <BR> Mailer.AddRecipient sToName,sToAddress <BR> Mailer.Subject = sSubject <BR>&#039;---------------------------------------- <BR>&#039; Add Attachment <BR>&#039;---------------------------------------- <BR>if sAttachment &#060;&#062; "" then <BR>Mailer.AddAttachment sAttachment <BR>end if <BR>&#039;---------------------------------------- <BR>&#039; End Attachment <BR>&#039;---------------------------------------- <BR> Mailer.ContentType = "text/html" <BR> Mailer.BodyText = sMessage <BR>Mailer.SendMail <BR> if not Mailer.SendMail then <BR>response.write "error" <BR> else <BR>response.write "mail sent" <BR> end if <BR> set mailer = nothing <BR>end sub <BR><BR>When i call the sub using the code: <BR>CALL TrilogicalMail(REMOTE_HOST,FromName,FromAddress,To Name,CONTAT_US_MAIL,SUBJECT,"",a) <BR><BR>I get the following error: <BR>Error Type: <BR>Microsoft VBScript runtime (0x800A000D) <BR>Type mismatch: &#039;TrilogicalMail&#039; <BR>/trilogical/contact.asp, line 39 <BR><BR><BR>Cannot figure what&#039;s the problem, can someone help me? <BR><BR>Thx Esther <BR>

  2. #2
    Join Date
    Dec 1969

    Default And which line... line 39???<BR><BR>TIme to DEBUG DEBUG DEBUG.<BR><BR>One step at a time.<BR><BR>For starters, RESPONSE.WRITE every argument to the sub, as the first thing you do inside the sub.<BR><BR>Copy/paste what you get from your debugging if you can&#039;t see it yourself.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts