Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
19%
200 - 500 GB
30%
500 - 800 GB
4%
800 - 1200 GB
7%
1200 - 1500 GB
7%
1500 - 2000 GB
11%
> 2000 GB
22%
Total votes: 54

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 6th March 2019, 16:47
pradeepcr's Avatar
pradeepcr pradeepcr is offline
Junior Member
 
Join Date: Dec 2002
Posts: 24
pradeepcr is on a distinguished road
Baan: BaanIV - DB: Baan - OS: Windows 2000
Email attachment via custom report
Baan: Baan IVc4
C/S: Both

We have a requirement to send an email with an attachment. Recipient information is in one of the custom tables. When the clicks on continue, a report has to be sent as an attachment in an email to the recipient.

We are on Baan 4c4 and latest service pack and porting set.

Thank you!!!
Reply With Quote
  #2  
Old 8th March 2019, 11:12
cmartin's Avatar
cmartin cmartin is offline
Junior Member
 
Join Date: Jun 2013
Location: Germany
Posts: 8
cmartin is on a distinguished road
Baan: BaaN 4/5, ERP LN 10.3/10.5, with Sources and HiDOX - DB: Oracle - OS: Linux
Quote:
Originally Posted by pradeepcr View Post
We have a requirement to send an email with an attachment. Recipient information is in one of the custom tables. When the clicks on continue, a report has to be sent as an attachment in an email to the recipient.

We are on Baan 4c4 and latest service pack and porting set.

Thank you!!!
Hi!
what is you question? If you want to know how to send a mail I would recommend you to use the Baan eMessage Connector if available in B4. In case it's not available I would use some shell script or other executable.
As you arent using a question mark, it is hard to figure out what your question or problem is.
__________________
Never confuse people with how you are doing it, when you can confuse them with what you are doing.
Reply With Quote
  #3  
Old 8th March 2019, 16:47
pradeepcr's Avatar
pradeepcr pradeepcr is offline
Junior Member
 
Join Date: Dec 2002
Posts: 24
pradeepcr is on a distinguished road
Baan: BaanIV - DB: Baan - OS: Windows 2000
Thanks for the response. We are using a device called 'OUTLOOK' where the report is sent as an attachment in an email from outlook. My question is - how to pass the recipient email address from the program script into the outlook message and also send the email behind the screen?
Reply With Quote
  #4  
Old 10th March 2019, 20:05
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,220
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I don' think the emessage connector is available in 4c4. What we did was just use sendmail - I assume that is available for Linux. Based off the other post you made on the topic. Is it an option?
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 12th March 2019, 22:57
pradeepcr's Avatar
pradeepcr pradeepcr is offline
Junior Member
 
Join Date: Dec 2002
Posts: 24
pradeepcr is on a distinguished road
Baan: BaanIV - DB: Baan - OS: Windows 2000
Mark,
sendmail is available in our Linux and we can use shell command in the program script. But cannot send the report as an attachment.

So used a device type called OUTLOOK and the argument calls the outlook API and attaches the report to email - issue here is we should be able to pass the email id and send the mail automatically with out user input required.
Reply With Quote
  #6  
Old 13th March 2019, 14:37
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,220
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sorry we actually switched to mailx - and we used 2 different commands the uuencode I think makes the file an attachment.

cmd = "uuencode " &
err.file.name & " Errors.txt >> " & temp.file & " | mailx -s 'PeopleSoft/Baan Employee Errors (Automated Email)' " &
| strip$(email.addr) & "<" & temp.file

And in this case I think(not sure) - it send everything in the body of the message. You can even see where we did an update last year and I had to pause it because it was having a issue going out.
Code:
function send.some.msg(string mail.addr(1024), domain tppdm.cprj mail.cprj, string mail.body(255))
{
	string	temp.file(255), msgtxt(255), cmd(2048)
	long	inputfile, rc

| Create temporary file to copy the PC file to
	temp.file = creat.tmp.file$(bse.tmp.dir$())
	temp.file = strip$(temp.file)
	inputfile = seq.open(temp.file,"w")
	msgtxt = "Project " & strip$(mail.cprj) & strip$(mail.body)
	rc = seq.puts(msgtxt, inputfile)
	rc = seq.flush(inputfile)
	rc = seq.close(inputfile)

	cmd = 	"mailx -s " & chr$(34) &"Project " & strip$(mail.cprj) & chr$(34)& " " & strip$(mail.addr) & "<" & temp.file
	rc = shell(cmd, SHELL_NO_OUTPUT)
	suspend(2000) 	| 20180801 - add suspend to give the email a few seconds to get set.
	rc = seq.unlink(temp.file)
}
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 13th March 2019, 17:41
pradeepcr's Avatar
pradeepcr pradeepcr is offline
Junior Member
 
Join Date: Dec 2002
Posts: 24
pradeepcr is on a distinguished road
Baan: BaanIV - DB: Baan - OS: Windows 2000
mailx worked similar to sendmail utility but not the attachment command did not work. it did not give any errors but does not do anything, not even an email is sent. Thanks for your help. Do let me know if you come across any other commands that can do attachments.
Reply With Quote
  #8  
Old 13th March 2019, 18:50
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,220
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Did you try with uuencode? I shelled out to unix and did this manually at the unix prompt:
uuendcode search.csh errors.txt>>test1.txt - this create the encoded file.
mailx -s 'Test' myemailaddress.com <test1.txt - mail the file

It came into my email as an attachment. Of course nothing in the body of the message but it was an attachment that I could read and see my shell script. Not pretty but it did work.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #9  
Old 13th March 2019, 18:55
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,220
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I did it again but this time I did:
uuendcode search.csh errors.txt>>test1.txt - this create the encoded file.
cat search.csh errors.txt>>test2.txt
mailx -s 'Test' myemailaddress.com <test2.txt - mail the file

This time I got the script in the body of the message and as an attachment.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
  #10  
Old 19th March 2019, 18:59
pradeepcr's Avatar
pradeepcr pradeepcr is offline
Junior Member
 
Join Date: Dec 2002
Posts: 24
pradeepcr is on a distinguished road
Baan: BaanIV - DB: Baan - OS: Windows 2000
This is my code.... it is not doing anything

e = shell("uuendcode mail.file>>test.txt", 0)
e = shell("mailx -s 'Test' mail.to <test.txt", 0)
suspend(2000)
e = shell("cat mail.file>>test2.txt", 0)

This code sends email but not as an attachment

e = shell("cp " & mail.file & " $HOME/stkomail ", 0)
e = shell("cat $HOME/Fileout" & " >> $HOME/stkomail", 0)
e = shell("/usr/sbin/sendmail -t -oi < $HOME/stkomail", 0)
e = shell("rm -f $HOME/Fileout" , 0)
Reply With Quote
  #11  
Old 20th March 2019, 00:09
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,220
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Do it by hand with a test. For uuencode I would add the copy command in front. When you shellout it typically runs in your home directory. I would login into baan, start a shell, manually run the copy, the uuencode (NOT Uuendcode - notice spelling) and the mailx.

e = shell("cp " & mail.file & " $HOME/stkomail ", 0)
e = shell("uuendcode mail.file>>test.txt", 0)
e = shell("mailx -s 'Test' mail.to <test.txt", 0)
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoices printing issue-display last record with 2 lines tracylee Tools Development 7 20th October 2017 11:51
Converting report to PDF while sending as Email attachment kmarella Miscellaneous 9 25th June 2010 22:03
Scheduling and drafting email for Baan Report / Excel Analysis Hitesh Shah Blogs and Web links 0 28th May 2009 17:05
solving recursion problems rmarles Tools Development 2 25th January 2005 22:23
Custom report session Sandy Blondino Tools Development 14 16th July 2003 23:22


All times are GMT +2. The time now is 10:02.


©2001-2018 - Baanboard.com - Baanforums.com