VishalMistry
8th September 2015, 09:26
Hi all,

I want to launch excel on erpln server. My purpose is as below:

Whenever a warehouse receipt is confirmed against a PO that has purchase requisition link, a mail is sent to the person who raised purchase requisition and also to buyer.

I have configured outlook profile and checked sending test mail. it is working okay (manually double clicking an excel file with auto_open() macro that sends me a test mail). but launching it through following command does not work:

app.id = run.prog("excel.exe " & "d:\erpln\bse\tmp\mews\email.xlsm","" ,RP_NOWAIT)

I dont know what is wrong. What should I do to send mail from erpln server ?

Please guide.

Vishal

bhushanchanda
8th September 2015, 11:16
Hi,

There are better ways to send email from server.

1. Try using eMessage Connector API which includes CMF functions to build and send the email.
2. Try these links -

1 (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1753)
2 (http://www.baanboard.com/baanboard/showthread.php?p=189527)
3 (http://www.baanboard.com/baanboard/showthread.php?p=191040)
4 (http://www.baanboard.com/baanboard/showthread.php?p=189417)
5 (http://www.baanboard.com/baanboard/showthread.php?p=171972)
6 (http://www.baanboard.com/baanboard/showthread.php?p=191765)
7 (http://www.baanboard.com/baanboard/showthread.php?p=4583)

These are enough to get you going.

For your code, try the following and check the log file.

"d:\erpln\bse\tmp\mews\email.xlsm" is an argument to excel.

app.id = run.prog("excel.exe","D:\erpln\bse\tmp\mews\email.xlsm", ,RP_WAIT,"","","D:\erpln\bse\tmp\mews\log_file.txt")

This will create the error log if any.

VishalMistry
8th September 2015, 11:37
Hi Bhushan-ji,

Thank u very much.I am trying to use emessage connector but it is not giving any error message.

The stat = cmf.send(mid,service) call returns zero, and displays error. I do not know where does it store log related to this. I have checked everything (SMTP service provider and all it's parameters).

Also app_start returns -1 so even that is not starting in my case.

Can you help me in this regard ?

Vishal

bhushanchanda
8th September 2015, 12:12
Hi,

For sending emails using SMTP, your mail server should have Relay Access. Please verify that. If the server lets relay access, you might solve the issues.

For logs, check $BSE/log/log.cmf

For checking the relay access, you can check this link (http://www.wikihow.com/Send-Email-Using-Telnet)

Try the commands from command line to check if the mail is sent. If yes, then its your coding issue. Else, its mail server issue.