NAS and smtpmailx

satanbis2
satanbis2 Member Posts: 24
Hello,

I have a code unit that send an e-mail with smtpmailx ocx.
From nav client, no problem
From Nas, I receive an error in event log :
"This message is for C/AL programmers:
Could not create an instance of the OLE control or Automation server identified by
GUID={79766A7F-90D7-4143-8B23-83A78097E880}.
Check that the OLE control or Automation server is correctly installed and registered."

NAS and client are on test on my pc, and use the same windows login account.


Here, my codeunit :


smtp.NewMessage('adr@dns.be','test');
smtp.SetWorkMode();
smtp.SetHost('ip');
smtp.SetUserID('user');
smtp.AddLine('jjj');
smtp.SetToAdress('adr@dns.be');
smtp.Send;

smtp is defined like : "Name DataType Subtype Length
smtp OCX SmtpMailX Element "



Any idea ?

Thx

Comments

  • sendoh
    sendoh Member Posts: 207
    IF ISCLEAR(smtp) THEN
      CREATE(smtp);
    

    i think you missed this --^
    Sendoh
    be smart before being a clever.
  • satanbis2
    satanbis2 Member Posts: 24
    ISCLEAR and Create are for type Automation,

    And smtp is of type OCX If I try to add that, I can't compile
  • rajpatelbca
    rajpatelbca Member Posts: 178
    ISClEAR and CREATE are two functions.
    ISCLEAR (Automation)
    Use this variable function to check whether an automation object has been created or not.
    CREATE (Automation)
    Use this function to create an Automation object.
    smtp is your ocx used in your code.
    Experience Makes Man Perfect....
    Rajesh Patel
  • sendoh
    sendoh Member Posts: 207
    sorry for that:oops: i missed this
    smtp is defined like : "Name DataType Subtype Length
    smtp OCX SmtpMailX Element "
    Sendoh
    be smart before being a clever.
  • satanbis2
    satanbis2 Member Posts: 24
    yes, but

    my variable "smtp"
    is defined of type "OCX" and not "automation"

    So the 2 functions don't work


    p.s. I'm on Nav4.0 SP3
  • kine
    kine Member Posts: 12,562
    The smtpmailx have sometime problems. Try to use another DLL like Free JMail or the SMTP from NAV 5.0...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • rvduuren
    rvduuren Member Posts: 92
    Hello,

    Hava a look at the SMTP mail functionality of Dynamics NAV 5, you can easily downgrade it to 4 as far as i know. Objects: T-409, F-409 and CU-400
    Met vriendelijke groet, best regards,

    Rvduuren
  • satanbis2
    satanbis2 Member Posts: 24
    Thx,

    I use smtp from 5.0 and that work