code to send email directly in dynamics axapta

You can try following code in job to send email directly to particular email.


 Sysmailer mailer;  
 ;  
 mailer = new sysmailer();  
 mailer.fromAddress("abc@yahoo.com","abc");  
 mailer.tos().appendAddress("acx@rediffmail.com","acx");  
 mailer.subject("Hi");  
 mailer.htmlBody("Hi");  
 //mailer.SMTPRelayServer("smtp.gmail.com");  
 //mailer.attachments().add(@"D:\sd\dfdt.txt");  
 mailer.sendMail();