how to send mail Automatically using job queue and NAS

himanshuhimanshu Member Posts: 24
edited 2013-11-25 in NAV Three Tier
hi all...
I am trying to send mail automatically using job queue and NAS services but when I assign startup codeunit in admirations tool it gives me and error "The program could not make a connection to the server".
Thanks&Regards
Himanshu Yadav
(Dynamics NAV)

Comments

  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Take a look at the SMTP Mail Setup page/table.

    Note: if you have no idea about the authentification or even what that means, assume Basic. So far it worked for me :)

    Note: my code looks like this:
    SendReportMail(MailAddress : Text[500];Subject : Text[500];Body : Text[1000];Attachment : Text[500])
    
    
    //MAIL	Codeunit	SMTP Mail	
    
    CLEAR(MAIL);
    MAIL.CreateMessage('navision_reporter@mycompany.com','navision_reporter@mycompany.com', MailAddress,
          Subject, Body, TRUE);
    
    IF Attachment <> '' THEN
       MAIL.AddAttachment(Attachment);
    
    SLEEP(3000); // wait 3 seconds for the attachment to attach or whatever
    
    MAIL.Send;
    
    

    It works.

    In 2009 SP1.
Sign In or Register to comment.