therese
10th July 2002, 08:34
I have read some threads for sending baan reports to email device but I can't find one to fit our requirements.

Our OS is NT and Mail server is Microsoft Exchange. We want to automatically broadcast some baan reports thru email to specific users. The baan report will be send every morning (or as scheduled) without manual intervention.

Can we able to do this without buying a third party product?

Thanks.:confused:

norwim
10th July 2002, 10:32
Hi there -

you should be able to achieve this with a vbs-script (then started with AT).
What I would do (as I loathe NT and VB(S)) is the following:
create an AT job on NT to automatically ftp
(ftp -s:FILEWITHFTPCOMMANDS)
the report in question to a unix/linux box and mail it from here *grin*.
Another hint: Use ttstpconv with option HTML to create the mail-body, otherwise it will look awful (thanks again to the friendly people here who gave this advice to me)

good luck

Norbert

Darren Phillips
10th July 2002, 10:32
Create a postcript device then create a job of the print session, set it to use the postscript device and select a location and filename for the output. Then either set an nt batch file to run after the report or better still use add shell command to job so it will run straight after the report. in this script use ghostscript http://www.cs.wisc.edu/~ghost/ to convert the ps file to a pdf then use Blat http://www.interlog.com/~tcharron/blat.html to distribute the emails.

therese
20th July 2002, 03:38
Hi Darren,

How can I be able to use blat? I have printed documents regarding this blat but honestly I can't still make it run. Do you have detail instruction to use it?

Thanks.

Darren Phillips
22nd July 2002, 11:57
below is part of one of my scripts the c:\invoices\invoice.pdf tells what file to attach in the mail the -subject "pdf of Sales invoices" sets the email subject the -to sets who gets the mail -server sets the the server it should send to. this server should be running an smtp service on port 25 if you using a different port then look at the blat documentation. -f sets the sender name and the -uuencode sets the attachment to be sent as uuencoded.

Tip
if you don't have any unix machines in your network and you are on NT4 server then you may not be running any internal DNS services or the network settings on your baan server may not be setup to resolve using DNS if this is the case then add an entry in your file c:\winnt\drivers\etc\hosts

ip address of smtp server FQDN
eg

192.168.1.1 exchange.toyoda-tauk.com


Blat.exe c:\invoices\invoice.pdf -subject "pdf of Sales invoices" -to
userXXXXX@toyoda-tauk.com,darren.phillips@toyoda-tauk.com -server exchange.toyoda-tauk.com -f Baan@toyoda-tauk.com -uuencode

carice
22nd July 2002, 13:18
Do you work with Outlook?

I have post some code in 'code and utilities' to mail whatever you with baan. You can even put drafts in special folders (folder reminders, ...) or send directly , ... . It's not so much code and it works very nice. It's a good base to start with a flexible way for mailing purposes.
First try to implement this with a simple session (from, to, subject field) and continue button. If this works you can mail from baan. Afterwards i will give you a clue how to let it work with any reports (even without an inputsession, if you can access the necessary data).

therese
25th July 2002, 03:11
Hi carice,

Yes, I am working with outlook.

I have read your script on Code and Utilities. I am working with this automatic email for a week and I am hoping you can help me work this stuff.

I have some questions/clarifications below.

1. The first thing I will do is to create a session (Is it maintain?) and a new table with the fields you have mentioned on your post. Then create a button <send email>.To make this button work, I have to use your baan script. Am I right?

2. Do I need to install a VB for the VB program on your post? OR I'll just do it in a text file then put it in the system directory(?). In what specific windows directory I will put the text file?

3. I want baan report to be send as attachement. How can I be able to do this using your script?

4. In the TO field, is it possible to have multiple recipient? What will be the input format. I mean what separator can be used if we will send the email to multiple recipient. (e.g. email address1,email adrress2)

Thanks and Regards,

Therese

carice
25th July 2002, 09:32
1. First of all , you have to create a new maintain session, that's right. You don't have to create a new table (you can if you want store all the data in a table but that's not necessary because if you send there will be a copy in your outlook send box); try to make it work first with an easy program.
In the maintain session you put some formfields in it. You can use (but you can program more, these where the fields that i needed) :

extern domain tcmcs.s256 frmFrom
extern domain tcmcs.s256 frmTo
extern domain tcmcs.s256 frmSubject
extern domain tcmcs.s256 frmBody
extern domain tcmcs.s256 frmCat
extern domain tcmcs.s256 frmBCC
extern domain tcmcs.s256 frmCC
extern domain tcmcs.s256 frmAtt
extern domain tcmcs.s256 frmAction

but here again , first make it easy; start with frmTo and frmSubject and frmAction; so you can see if it works.
This frmAction must be filled with

"move" (will move a non send mail to a new folder, named Outbox Baan under folder outbox, from there on you can verify the mail and send it)
or "copy" (set mail in Outbox folder)
or "save" (will keep the mail as a draft in the draft folder)
or "send" (will send the mail directly)
This frmAction doesn't need to be a formfield, you can fill it in your script.

Yes, there will be a button <send_email> and when you pushed it, it will do this function. This is the baanscript mentionned in the thread.
So you just have to create a maintain, a few formfields, and a button.

2. After the baanscript, there are TWO more scripts left.
The second is a vbs-script, the last is the script of the VB-DLL. This vbs-script is just like a textfile, you don't have to compiled it, ... . You just copy the code to a text-file and name this textfile 'outlook.vbs'. This vbs-script must be accesible from your pc by baan; therefor i just copied it in the system directory, so that this script is always accesible(this PATH is always know). (I know that this can be better, but i don't have the time to do it; i thought that it would be better to put this vbs-script on the server and when the baan-session runs, it will copy the script local, use it and delete it local again ; because now you have to copy this vbs-script to every pc that will use the session and when you work like mention above, you don't have to do this; also a good solution is that you set the vbs-script on the server and in the baanscript you just give the whole path).
But first of all keep it simple and copy it to your system directory, to let it work.
The third thing is the VB-DLL. Therefor you need VB, if you want to modify the script. I will send you the DLL, so you don't have to install VB as long as you don't won't to modify the script.

3. If everything works (with fields to ,subject and action), you can use more formfields like frmBody, frmCC, frmAtt.
To mail attachments, create a new formfield and name it frmAtt, you can put the filename (with path)in it and this file will be send with your mail. There is a way to send mails directly with this program (so without a maintain session but just by creating a new device). But first (here i come again) let it work first with a maintain session.

4. Yes it's possible, you can just put in the emailadresses like you do now in outlook; here the seperator is ';'. You can just put in the names like you do if you normal send a email (here we use the loginnames and not the whole emailadresses).

Hopefully this will help you.

Let me know if it works
:p

therese
26th July 2002, 08:50
Hi carice,

I have encountered error "Unresolved reference to function app_start" while compling the script. How can I be able to solve this?

I have attached the error message and part of the script.

Thanks.

~Vamsi
26th July 2002, 08:53
#pragma used dll "ottdllbw"
Add the above line to your code.

therese
27th July 2002, 02:39
Vamsi,
Thanks. My script works now.


Hi carrice,

I’ve done the ff. based on your instructions.

1.I ‘ve created a session, a few fromfields and a button (with the function send email).

2.I’ve copied files VBBaan.dll, VBBaan.lib, VBBaan.vbp, VBBaan.vbw, VBBaan.exp, Outlook.vbs in Winnt/System32 directory.

After clicking on the <Send Email> button and look on my MS Outlook, I have encountered error message

“AN EXCEPTION TYPE OF RUNTIME ERROR WAS NOT HANDLED”
WOULD YOU LIKE TO DEBUG THE APPLICATION?

And when I click <NO>, The message below appears.

Windows Scripting Error:

Script: C:\WINNT\System32\outlook.vbs
Line: 19 Column: 0
Category: Microsoft VBScript Runtime error
Description: ActiveX component can’t create object ‘VBBAAN.BAANVB’


What seems to be the problem?

Hope you can help me.

Thanks and Regards,
Therese

carice
28th July 2002, 17:57
hi,

you're very close now.

i 'm not in my office now so i can't check it (and i'm on holiday now).

Try something of these;

- i think that i have copy the dll in the baan directory (lib or bin; look where the dll's are in).

- can you install VB on your pc? It will be very simple if you create a dll in vb yourself; you have the code. If it 's installed on your pc , you have all the necessary dll's and ocx's needed.

Let me know if it's work

carice
28th July 2002, 18:16
hi,

i investigated a little more and i notice that i forgot to give you the class-file, i'm sorry.

Here is a new zip; let me know if it works now.

therese
29th July 2002, 04:21
HI carice,

Thanks for your response.

I have copied the VBBaan.dll to /baan/bin directory. I also included the BaanVB.cls in Winnt/system32 directory but I encountered the same error.

What seems to be the problem?

Thanks.

:(

andrew.page
4th September 2002, 18:16
Have you tried just outputting the required reports to file then using vbscript to send them to SMTP?

Eddie Monster
18th October 2002, 17:47
Therese,

I used the following unix script to send a file out of a Baan Print device as a .rtf format:

export EMAIL_TO='person1@place.com, person2@place.com'
export EMAIL_FROM='Baan'
export EMAIL_SUBJECT="Print Inventories by Item and Warehouse"
export FILE_NAME=emailrprt.rtf
export ATTACHED_FILE=$HOME/emailrprt.rtf
export EMAIL_BODY=/app/scripts/emailbody.txt

{
echo To: $EMAIL_TO
echo From: $EMAIL_FROM
echo Subject: $EMAIL_SUBJECT
echo 'MIME-Version: 1.0'
echo 'Content-type: multipart/mixed; boundary="xxxxyyyzzqzzyyyxxxx"'
echo 'Content-Transfer-Encoding: 7bit'
echo ''
echo '--xxxxyyyzzqzzyyyxxxx'
echo ''
cat $EMAIL_BODY
echo '--xxxxyyyzzqzzyyyxxxx'
echo 'Content-Type: text/plain; charset=US-ASCII; name="'emailrprt.rtf'"'
echo 'Content-Disposition: attachment; filename="'$FILE_NAME'"'
echo 'Content-Transfer-Encoding: 7bit'
echo ''
cat $ATTACHED_FILE
echo '--xxxxyyyzzqzzyyyxxxx--'
}|/usr/sbin/sendmail $EMAIL_TO

I would imagine that you could modify it to be called after you push the report through ghostscript to be sent to mulitple users. I haven't gone that far with it yet, but you may be able to.

The above script was taken from HP's website (www2.itrc.hp.com) document id KBAN00000710
entitled: shell scripts to send e-mail (with and without attachments)

jroberts
21st October 2002, 20:17
We have several baan reports that get e-mailed to a large group of people in an NT environment:

1)
A Baan job that runs the reports every day out to rewrite flat files.

2)
An NT AT command that e-mails them out using a MAILTO command.

This is really simple to get going, and we have been using it for 2 years with no problems.

GAURAVGUPTA9
17th December 2003, 13:16
hi all
i tried to send mail using blat but i can send mail to my intranet address but not outside of intranet...
how can i send my mails to outside...
plz help
thq...
regards
Gaurav Gupta

jroberts
17th December 2003, 14:44
Hi,
I had this problem with BLAT as well.
The issue is that your mail server (EXCHANGE in our case) was configured to not allow relaying \ forwarding of email to external receipents.

There are two solutions:
a) Change configuration settings in Exchange

b) Set up an Exchange distribution list with internal and external people in the list, and then just email to the distribution list.

The distribution list is nice, because it means that you do not have to edit a text file to change who receives the e-mail.

Good Luck,
John
PS, if you are stuck, PM me with your co-ordinates, and I'll see if I can help.

bamnsour
17th December 2003, 16:44
Our B2Email product uses blat for sending emails through SMTP.

This is how you solve your problem with blat when you have Exchange as your outgoing mail server and you can send emails inside your domain but not outside it.

- Exchange Administrator
- Connections
- Internet Mail service
- Properties
- Routing
- Reroute incoming SMTP mail (required for POP3/IMAP4 support)
- Routing - Sent to: [domain of company] - Route to: <inbound>
- Routing Restrictions ...
- Hosts and clients with these addresses:
- IP-Adress [IP of Baan-Server] Mask 255.255.255.255
then stop and restart Internet Mail Service on Exchange-Server

GAURAVGUPTA9
18th December 2003, 06:46
hi all
thanx for ur valuable reply....but here we have lotus notes and i dont know about much of it...so can ne body help me out...
Thq
Regards
Gaurav Gupta

manojsharma
18th December 2003, 07:38
Hi Carice,

I have tried as you have mentioned, it works but give same error message as given by Therese

Script: C:\Windows\System\outlook.vbs
Line: 19 Column: 0
Category: Microsoft VBScript Runtime error
Description: ActiveX component can’t create object ‘VBBAAN.BAANVB’

Can you please send complied outlook.vbs

Thankx

bamnsour
18th December 2003, 08:17
This is what you need to do with Lotus Notes:

You should have the Outgoing Mail Server field looking at
your SMTP relay (talk to your Notes Administrator)
Outgoing Port Number should be set to 25 & retries set to 1.

Check your domino server is converting any mail going to a internet domain into a SMTP mail (should be the case anyway).

monica1
19th December 2003, 12:52
The .DLL must be in WINNT/SYSTEM32 and you must to register it.

To register you have to call REGSVR32 <.dll> in command line in windows.
Then outlook.vbs goes well.

avpatil
21st December 2003, 00:33
Hi,
There are many ways. One solution is to use some email shareware. I use a email sharewar that send an HTML body as an email. This works really cool. You have to see it to believe it. One of the email we send it shipment notification to our customers when goods are shipped. And I use this program to send email. It has hyperlinked to the carrier websites which is used for shipping. In fact I have developed a whole alert system based on this shareware.

I would defiently recommed this, insteas of an Baan postrscript etc. You can generate a an HTML tagged report from Baan and just use such programs to send it.


Arvind

novicebaan
29th December 2003, 08:41
i have seen the thread for creating automatic sending of baan report without human intervention.

Our OS is unix and we are using Baan client in window-xp. We have implemented Lotus Notes as
for the email facility. Pl write in detail what steps we have to follow for sending BaaN reports to
our customer daily basis. We donot want to buy third - party s/w
Pl write me also what will be the common points we can implement through this thread & what extra
works to be done to achieve this

NoviceBaan

Andre.A
30th December 2003, 12:39
Hi !

why dont you use the mailx command on unix itself ?

e.g. without file appending:

comand.line ="mailx -s """ & strip$(shiftl$(subject)) & """ " &
t.recipient.adrs & " <" & strip$(shiftl$(sourcefile))
| sourcefile is mail text

shell(comand.line, 0)

with file:

comand.line = "uuencode " & strip$(shiftl$(sourcefile)) & " " &
strip$(shiftl$(filename)) & " | " & "mailx -s """ &
strip$(shiftl$(subject)) & """ " & t.recipient.adrs

shell(comand.line, 0)

best regards

manojsharma
5th January 2004, 11:41
Hi Andre,

thanx, its working fine but there is only one issue, the mail generated either with body or with attachment.

I want to generate mail with body as well as attachment as I want to send sales order to customer through e-mail as attachment and also I want to write some text as body.


Thanx in advance

monica1
17th February 2005, 08:36
I change the Carice program and in this one it's possible to attach files and body. But only one file it's possible to send. If someone know how to send more than one file please notice me.
Thank you,

manojsharma
18th February 2005, 06:17
Thanx Monica, I will try & revert back 2 u

sanjayroongta
27th July 2005, 08:57
Hi Manoj

Have u tested, what is your feedback

manojsharma
27th July 2005, 12:11
Hi sanjay,

I have tried but its giving error -19 active-x component can't create object "VBBAAN.BAANVB"

vsauer
27th July 2005, 15:46
I think the easies way to use blat is this device definition:
Datum : 27.07.05 [15:44] DRUCKERDATEN (ERWEITERT) Seite : 1
System VIMSERP1 Firma : 000

--------------------------------------------------------------------------------
Drucker : M
Druckerart : In Datei schreiben
Treiber :
Bezeichnung : Sendet Mail an "Ausgabedatei"
Warteschlange :
Papierart :
Papierformat :
Seitenlänge : 99
Linker Rand : 0
Pfad : user@server.de(your Mailadrese)
Ändern zulässig : Ja
Konv.programm : ttstpconv
Argument : ascii\blat %s -t %s -s Baanprotokoll
Seitenvorschub :
Locale : ISO-8859-1

Blat.exe must be configured on the Baan server and in PATH $BSE\bin

avpatil
27th July 2005, 15:48
Hi,
Blat can be on anywhere on the network. I have done on entirly different machine and called it using UNC server. It is neat little program.

Arvind

manojsharma
28th July 2005, 07:19
Hi Sanjay,

Its working now, I got it. Thanx Monica Thanx everybody

mr_suleyman
28th July 2005, 07:31
Hi ,
Does it works on Baan IV c3 ? or how does it works on Baan IV c3 ?

Thanks in advise

sanjayroongta
29th July 2005, 14:20
Hi Manoj

Reg. your problem on Andre post. You can try this

( cat test.doc
uuencode x.doc x.doc
) | mailx -s "test" -r a@abc.com b@abc.com

test.doc contains the body of message.

rgds
Sanjay

manojsharma
1st August 2005, 08:02
It works

Thanx again

george7a
1st August 2005, 14:22
Hi,

Using The Nazdaq B2Email products you can send emails throug MS outlook. You can see the emails sent in the Sent Items folder.

www.nazdaq-it.com

markybrum
26th January 2009, 15:54
hi,
would you send me the baan4 script of your solution (e-mailing reports for free)?
bruchmann@bego.com
thx

eric.dizon
14th November 2012, 22:00
I am using LN FP7 ;
I am trying to find out a way on how to send an email to multiple recipients

Like what is indicated here
4. In the TO field, is it possible to have multiple recipient? What will be the input format. I mean what separator can be used if we will send the email to multiple recipient. (e.g. email address1,email adrress2)

I've used

email1@email.com ; email2@email.com and it doesn't work.

Can you please point me to the right direction?

NPRao
15th November 2012, 00:48
email1@email.com ; email2@email.com and it doesn't work.
use comma as the separator