thnx a lot 4 ur kind cooperation.
--- In Axapta-Knowledge-Village@yahoogroups.com, Malcolm Burtt <malcolm.bu...@...> wrote: > > Hi > > If you're going to use the SysMailer class (which, unlike the MAPI and > SysInetMail classes, allows you to send an email without needing a mail > client installed on the AX client machine) then you really need to call the > SysMailer.SMTPRelayServers().add() method using the address of your local > mail server (e.g. your Exchange Server). If you don't do that then SysMailer > will attempt to send your mail directly to the intended recipients and to do > that it will look up the address of their mail server. As you've not given > SysMailer any indication of where you DNS server is (SysMailer doesn't > implement a means to do this although the underlying Dundas mailer DLL does) > it has to go to the Internet ROOT DNS servers in order to find the address of > the recipient's mail server...and the ROOT DNS servers are busy beasts so > that takes a long time. Once SysMailer gets that address it can attempt > direct delivery but, and this is what probably happened in your case, if the > recipient mail server is down then SysMailer cannot send the message and you > get an error along the lines that you saw. > > If you modify your code so that it calls SysMailer.SMTPRelayServers().add() > passing the address of your local mail server in the add() method then > SysMailer only needs to deliver the message locally. You mail server will > then forward it on to the recipient which is altogether a more reliable > method and much faster. > > You'll need to ensure that your mail server is set up to allow your AX AOS > machine to relay messages (normal mail server setup would block relaying > except for only a few listed machines) and you'll need to ensure that your > calls to SysMailer happen on the server tier. If you don't do this the mail > server will reject any attempt to email outside of your organisation. Local > emails will work fine but emails to another domain will be rejected by the > mail server. > > Regards > > > Malcolm Burtt > Touchstone Group > People - Partnership - Solutions > > > > From: Axapta-Knowledge-Village@yahoogroups.com > [mailto:axapta-knowledge-vill...@yahoogroups.com] On Behalf Of sameerak6 > Sent: 31 July 2009 10:35 > To: Axapta-Knowledge-Village@yahoogroups.com > Subject: [Axapta-Knowledge-Village] send mail via axapta > > > > hi all; > > im using axapta 3.0. > i wanted to send a mail via da axapta. > i used sysmailer class and following job. > > static void mail_send(Args _args) > { > > SysMailer mailer = new SysMailer(); > mailer.body(" "); > mailer.subject(" "); > mailer.fromAddress("[EMAIL PROTECTED]"); > mailer.fromName(" "); > mailer.tos().add([EMAIL PROTECTED]); > mailer.sendMail(); > print 'done'; > pause; > ) > > when i vs executing the job flowing error occurred. > " Method 'Send Mail' in Com Object of the class "Dudans.mailer" returned > error code. Hello command failed. > > plz help me, to be sorted this problem. > is there any method to send a mail instead of using SysMailer class?. > > Thank You > Sami >