diff. b/w sysmailer and sysinetmail?

diff. b/w sysmailer and sysinetmail?

I think you must be looking into this difference of these for sending email from ax 2009.

I hope this difference may help you.

  • SysMailer:

In the following code you can see how to use SysMailer class for sending mails. To use SysMailer class you need to set Relay server or computer name, user name and password in Administration –> Setup –> Email parameters form. This class internally uses CDO.Message dll for communication purposes.

static void emailThruSysMailer(Args _args)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
;

if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}

mailer.fromAddress(‘sumit.loya@sumitloya.com’);
mailer.tos().appendAddress(‘sumit.loya@sumitloya.com’);
mailer.body(‘hi’);
mailer.sendMail();
}

SysInetMail:

SysInetMail internally uses Mapi framework only. But to use SysInetMail one has to setup email templates from Basic –> Setup –> Email templates. SysInetMail will automatically pick sender id, subject, sender name, email text etc. from the email template that you provide while sending from SysInetMail. If you provide a full email address and not the id from Email templates table then also mail will be sent but in that case you need to provide the details yourself.

static void emailThruSysInetMail(Args _args)
{
SysInetMail mail = new SysInetMail();
;

//To send to an email address directly
mail.sendMailAttach(‘sumit.gupta@power.com’, ‘sreenath.sharma@tcs.com’, ‘Test mail’, ‘Hi There’, false, ‘E:\Test\4000.pdf’);

//To use an email template to send mail
SysInetMail::sendEMail(‘Alerts’, ‘en-us’, ‘sumit.gupta@power.com’);
}

Please search in this forum before posting your queries

I did a quick search and found this - http://dynamicsuser.net/forums/p/16715/78763.aspx#78763

Hi, Is there any way in which I cans end emails using the SysMailer class using the email template. Or, can I attach multiple CC/ BCC/ Attachment in SysInetMail. Thanks, Saurabh