Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
22%
Total votes: 45

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th June 2018, 09:24
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 491
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
cmf.send() not sending the mails
Baan: Other/Unknown
C/S: None/Unknown

Dear Members

I was trying out to send the mail through the Emessager connectors and i have provided the given below Code

Code:
if mid <>0 then
                stat = cmf.startService(service,2)
                if stat<>0 then
                        message("Message could not be sent "&
                        	"(Infor ERP Enterprise eMessage Connector"&
                        	" service did not start)")
                        exit()
                endif
                stat = cmf.send(mid,service)
                if stat<>0 then
                        message("Message could not be sent "&
                        	"(Infor ERP Enterprise eMessage Connector "&
                        	"service refused message)")
                        cmf.stopService(service,2)
                        exit()
		else
			message("Message successfullly sent.....Supposedly")	
                endif
                stat = cmf.stopService(service,2)
        endif
Code:
  message.ID = cmf.create()
        body = ttyeno.yes
	
	
        ret = cmf.setClass(message.ID, "CMF.NOTE")
        ret = cmf.setSubject(message.ID, "Sample CMF Message")

        |Set FROM recipient
        from.ID = cmf.createRecipient(message.ID, ttcmf.role.from)
        ret = cmf.setRecipientName(from.ID, "Ajesh")
        ret = cmf.setRecipientAddress(from.ID,"ajesh@test.com")
        ret = cmf.setRecipientType(from.ID, "BAAN")
        |In reality of course the from address could be filled from
		|the Address book.

        |Set TO recipient 
        to.ID = cmf.createRecipient(message.ID, ttcmf.role.to)  
        ret = cmf.setRecipientName(to.ID, recipient.name)
        ret = cmf.setRecipientAddress(to.ID, recipient.address)
        ret = cmf.setRecipientType(to.ID, "SMTP")
        ret = cmf.setRecipientResponsibility(to.ID, "TRUE")

I have put the Recipient Name and Address a valid one. The Message Log says the Message has been successfully sent but i cant get a mail


Regards
Ajesh
Reply With Quote
  #2  
Old 20th June 2018, 19:16
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,059
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
Ajesh,

This looks like the standard example code from the Tools Programmer's manual.
I assume you have already completed the SMTP setup on the LN/Baan Application server?

Also, in your code you set the From-address to yourself and not the To-address.
Code:
      |Set FROM recipient
        from.ID = cmf.createRecipient(message.ID, ttcmf.role.from)
        ret = cmf.setRecipientName(from.ID, "Ajesh")
        ret = cmf.setRecipientAddress(from.ID,"ajesh@test.com")
        ret = cmf.setRecipientType(from.ID, "BAAN")
        |In reality of course the from address could be filled from
		|the Address book.

        |Set TO recipient 
        to.ID = cmf.createRecipient(message.ID, ttcmf.role.to)  
        ret = cmf.setRecipientName(to.ID, recipient.name)
        ret = cmf.setRecipientAddress(to.ID, recipient.address)
        ret = cmf.setRecipientType(to.ID, "SMTP")
        ret = cmf.setRecipientResponsibility(to.ID, "TRUE")
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #3  
Old 22nd June 2018, 15:10
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 491
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Mister Rao, the SMTP Server seems to be working as i had created a SMTP Device and it was sending the Mail.

May be the Port Number which i mentioned in the Service Provided is the problem, 25? I tried with 587 but it didnt work...

Also the Recipient Name and Address i had set in LOC previous to this Function..
Reply With Quote
Sponsored Links
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
Error sending PO textfile through ERPLn Emsg connector VishalMistry Tools Development 1 17th November 2015 15:06
sending mail from script sang1285 Tools Development 2 30th September 2014 14:26
SMTP Service is not Sending Mails through Script info_erp Tools Development 27 2nd May 2014 13:45
Automation of sending mails from Outlook 2003 AlluRajasekhar Tools Development 11 1st August 2008 21:22
problem in sending mails GAURAVGUPTA9 Tools Development 0 17th December 2003 13:18


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


©2001-2017 - Baanboard.com - Baanforums.com