PDA

View Full Version : ASPEmail query


dominicall
10-23-2002, 08:29 PM
Anyone here ever used the Persits ASPEmail component at all.

There's a great method for adding the body and altbody of the email from external files - but I can't seem to get the thing to work...

The info on their site says:

--------------------

AppendBodyFromFile(Path as String, Optional AddToBody)

Appends the Body property from a text or HTML file specified by Path. If AddToBody is specified and set to False, the content of the file is appended to AltBody instead of Body. This is a premium feature.

-------------------

When I add the following code:

Mail.AppendBodyFromFile "c:\inetpub\wwwroot\agents\test\test.txt", AddToBody = False

I get the following error...

Variable is undefined: 'AddToBody'

Anyone able to help??

Thanks

Dominic :confused:

BigDaddy
10-23-2002, 10:13 PM
Probably too simple, I'm guessing you've already checked, but have you dimmed AddToBody? Have you specified Option Explicit?

whammy
10-24-2002, 12:31 AM
I get that error when I forget to Dim something, since I usually use Option Explicit to help with debugging.

dominicall
10-24-2002, 04:54 AM
I figured it out about 1 hour ago - I left it and then went back to it...

... nothing to do with Option Explicit - always use that in every page...

just got the code wrong...

The correct code is...

Mail.AppendBodyFromFile "c:\inetpub\wwwroot\agents\test\test.txt", False

Had my stupi hat on earlier...

Dominic :o

BigDaddy
10-24-2002, 04:59 AM
I only suggested the dim or the option explicit thing because I've done it myself....

:D

whammy
10-24-2002, 11:45 PM
ditto.

dominicall
10-25-2002, 07:17 PM
LOL...

First two lines that always go at the top of every page are...

<%@LANGUAGE = VBSCRIPT%>
<%Option Explicit%>
Learnt that trick a long time ago...

Dominic

:D

whammy
10-26-2002, 04:32 AM
Now, everyone that is programming in ASP still, needs to pay attention to this post. :D