Hello,

Im having issues with emails, im trying to get Axapta to email us 
when a job completes. Unfortunatly using standard axapta emailing 
(tick the box on the batch tab) it uses the Outlook client on the 
machine.

As we run a batch server and run jobs at 2 - 3 am, and with Outlook 
2000 SP2 and above it now asks users if they want to confirm an 
external program is trying to access their address book, and click 
yes and yes.

I would like to change the way this works so that it uses our SMTP 
settings. As far as i can find there is in Administration - Setup - 
Email parameters a place for putting this info. However the batch job 
doesnt seem to use or recognise this?

Is there any way of turning on this functionality to work with the 
batch job please?

Ive also found the below code which works for sending data from a 
client which i thought i may be able to manipulate to run with the 
batch job:

static void ARB_EmailJob(Args _args)
{

// "regsvr32.exe C:\Axapta\Axapta_Client\Bin\dsmailer.dll"
// need to register dsmailer on client for this to work.

    SysEMailBatch mailer;
    Sysuserinfo     Sysuserinfo;
    userinfo        userinfo;
    str userid;
    str username;
    str emailadd;
    ;

 userid =  curUserId();  // Sets the username to the users current id

    emailadd = sysuserinfo::find(userid).Email;  // Finds the users 
(senders) email address

    while(!emailadd)
    {
        info(emailadd);
        emailadd = "Axapta";
        info(emailadd);
    }

    select userInfo where userInfo.id == curUserId();   // Selects 
User details
    username = userinfo.name;

    mailer = SysEmailBatch::construct();
    mailer.parmEmailAddr("[EMAIL PROTECTED]);
    mailer.parmMessageBody("This is a test message; Please 
disregard");
    mailer.parmPriority(emailPriority::Normal);
    mailer.parmSenderAddr(emailadd);
    mailer.parmSubject("Message from Axapta: " + Username);
    mailer.run();
}

Reply via email to