Link to home
Start Free TrialLog in
Avatar of dwaldner
dwaldner

asked on

Catastrophic Error when adding email body

Hi folks,

Here's the issue.  We've been using the SMTPsvg.Mailer object to send out emails for quite some time now.  But, it seems that when we execute this now, we get a "catastropic failure" error code when we reach the objNewMail.Subject line...

The problem disappears when the server gets restarted, but it crops up again after intermediate use (ie. 15-20 emails).  My first thought is that there might be a memory leak or something in the object code itself.  Has anybody come across this error before that could help?

Below is the code.  Thanks in advance....

Dan

Function sendHTMLEmail(fromName, fromAddress, toName, toAddress, subject, bodyText)
      Set objNewMail = Server.CreateObject("SMTPsvg.Mailer")
      objNewMail.RemoteHost = 'server ip address goes here
      objNewMail.AddRecipient toName, toAddress
      objNewMail.FromName = fromName
      objNewMail.FromAddress = fromAddress
      objNewMail.Subject = subject
      objNewMail.ContentType = "text/html"
      objNewMail.BodyText = bodyText
      objNewMail.SMTPLog = "e:\websites\common_programming\email.log"
      sendHTMLEmail = objNewMail.SendMail

      Set objNewMail = Nothing
End Function
ASKER CERTIFIED SOLUTION
Avatar of mouatts
mouatts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial