07.04.2010, 15:11 | #1 |
Участник
|
Добрый день.
Кто-нибудь научился отсылать почту из Navision 4.0? Написал функцию: Код: objEmail Automation 'Microsoft CDO for Windows 2000 Library'.Message objEmailConf Automation 'Microsoft CDO for Windows 2000 Library'.Configuration flds Automation 'Microsoft ActiveX Data Objects 2.5 Library'.Fields fld Automation 'Microsoft ActiveX Data Objects 2.5 Library'.Field --------------------------------------------------------------------------------------- SendEMail(FileName : Text[200]; ToEMail : Text[200]) --------------------------------------------------------------------------------------- IF ISCLEAR(objEmailConf) THEN CREATE(objEmailConf); flds := objEmailConf.Fields; fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver'); fld.Value('mail.mailserver.ru'); fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/smtpserverport'); fld.Value(25); fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/sendusing'); fld.Value(2); flds.Update(); IF ISCLEAR(objEmail) THEN CREATE(objEmail); objEmail.Configuration := objEmailConf; objEmail.From := 'fromuser@mailserver.ru'; objEmail."To" := ToEMail; objEmail.Subject := 'Тема письма'; IF FileName <> '' THEN objEmail.AddAttachment(FileName); objEmail.Send; CLEAR(objEmail); |
|