'=========================================================================== ' Subject: WRITE FIDO NETMAIL MESSAGES Date: 11-13-97 (21:00) ' Author: Bert van Dam Code: QB, QBasic, PDS ' Origin: bd1rsd@usa.net Packet: MISC.ABC '=========================================================================== 'Test program to write Fido Netmail messages for FrontDoor 2.02NC 'Bert van Dam august 1997 'This program writes fido netmails. Scan the source and check pathnames and 'ofcourse change my name and fido address into your's (unles you want to be 'me :)) 'Good luck, Bert 'The standard header TYPE MsgHdr FromUserName AS STRING * 36 'from, null terminated ToUserName AS STRING * 36 'to, null terminated Subject AS STRING * 72 'subject, null terminated DateTime AS STRING * 20 'datetime TimesRead AS INTEGER 'number of times read WORD DestNode AS INTEGER 'destination node OrigNode AS INTEGER 'origin node Cost AS INTEGER 'cost of message OrigNet AS INTEGER 'origin network DestNet AS INTEGER 'destination network DestZone AS INTEGER 'destination zone OrigZone AS INTEGER 'origin zone DestPoint AS INTEGER 'destination zone OrigPoint AS INTEGER 'origin zone ReplyTo AS INTEGER 'previous reply (in same area) Attribute AS INTEGER 'attributes NextReply AS INTEGER 'next reply END TYPE DIM Header AS MsgHdr RANDOMIZE TIMER 'This is were you fill in all the appropriate data FidoPath$ = "c:\qb45\fd" TmpPath$ = "c:\dos\tmp" YourName$ = "Bert van Dam" OriginatingZone = 2 OriginatingNet = 285 OriginatingNode = 750 OriginatingPoint = 16 ToName$ = "Eric Koen" DestinationZone = 2 DestinationNet = 285 DestinationNode = 750 DestinationPoint = 7 Subject$ = "Test" Message$ = "Hi, this is a test." 'Generate next message number Opdracht$ = "dir " + FidoPath$ + " > " + TmpPath$ + "\dir.lst" SHELL Opdracht$ OPEN TmpPath$ + "\dir.lst" FOR INPUT AS #1 DO UNTIL EOF(1) LINE INPUT #1, Regel$ IF INSTR(Regel$, "MSG") <> 0 THEN Nummer = VAL(LEFT$(Regel$, 8)) IF Nummer > HoogsteNummer THEN HoogsteNummer = Nummer END IF LOOP CLOSE #1 MessageNumber = HoogsteNummer + 1 'Generate a unique message identifier Number$ = LEFT$(DATE$, 1) + LTRIM$(STR$(INT(TIMER))) + LEFT$(LTRIM$(STR$(INT(RND(1) * 100))) + "00", 2) 'Build the standard header Header.FromUserName = YourName$ + CHR$(0) Header.ToUserName = ToName$ + CHR$(0) Header.Subject = Subject$ + CHR$(0) Header.DateTime = DATE$ + " " + TIME$ Header.TimesRead = 0 Header.DestNode = DestinationNode Header.OrigNode = OriginatingNode Header.Cost = 0 Header.OrigNet = OriginatingNet Header.DestNet = DestinationNet Header.DestZone = DestinationZone Header.OrigZone = OriginatingZone Header.DestPoint = DestinationPoint Header.OrigPoint = OriginatingPoint Header.ReplyTo = 0 Header.Attribute = 257 Header.NextReply = 0 'Build the extended header ToPoint$ = CHR$(1) + "TOPT " + LTRIM$(STR$(DestinationPoint)) + CHR$(13) + CHR$(1) FromPoint$ = "FMPT " + LTRIM$(STR$(OriginatingPoint)) + CHR$(13) + CHR$(1) MsgId$ = "MSGID: " + LTRIM$(STR$(OriginatingZone)) + ":" + LTRIM$(STR$(OriginatingNet)) + "/" + LTRIM$(STR$(OriginatingNode)) + "." + LTRIM$(STR$(OriginatingPoint)) + "@fidonet " MsgNumber$ = Number$ + CHR$(13) + CHR$(1) PID$ = "PID: FM 2.02" + CHR$(13) ExtendedHeader$ = ToPoint$ + FromPoint$ + MsgId$ + MsgNumber$ + PID$ 'Create the message file name f$ = FidoPath$ + "\" + LTRIM$(STR$(MessageNumber)) + ".msg" 'Write the message OPEN f$ FOR BINARY AS 1 'header PUT 1, 1, Header 'extended header PUT 1, LEN(Header) + 1, ExtendedHeader$ 'message PUT 1, LEN(Header) + LEN(ExtendedHeader$) + 1, Message$ CLOSE #1 'Print information CLS PRINT "Message number "; MessageNumber PRINT PRINT "From "; YourName$ PRINT " "; LTRIM$(STR$(OriginatingZone)); ":"; LTRIM$(STR$(OriginatingNet)); "/"; LTRIM$(STR$(OriginatingNode)); "."; LTRIM$(STR$(OriginatingPoint)) PRINT "To "; ToName$ PRINT " "; LTRIM$(STR$(DestinationZone)); ":"; LTRIM$(STR$(DestinationNet)); "/"; LTRIM$(STR$(DestinationNode)); "."; LTRIM$(STR$(DestinationPoint)) PRINT "Subject "; Subject$ PRINT PRINT "Was generated at "; DATE$; " "; TIME$; " hrs." END