It looks like you're new here. Sign in or register to get started.
PROCEDURE SendSMTP@1000000002(Sender@1000000000 : Text[50];From@1000000001 : Text[50];RcpTo@1000000002 : Text[50];Cc@1000000016 : Text[50];Bcc@1000000017 : Text[50];SMTPServer@1000000003 : Text[50];Subject@1000000004 : Text[150];HTMLBody@1000000005 : Variant;TextBody@1000000006 : Variant); VAR Mail@1000000015 : Automation "{CD000000-8B95-11D1-82DB-00C04FB1625D} 1.0:{CD000001-8B95-11D1-82DB-00C04FB1625D}:'Microsoft CDO For Exchange 2000 Library'.Message"; Config@1000000014 : Automation "{CD000000-8B95-11D1-82DB-00C04FB1625D} 1.0:{CD000022-8B95-11D1-82DB-00C04FB1625D}:'Microsoft CDO For Exchange 2000 Library'.IConfiguration"; Fields@1000000013 : Automation "{00000205-0000-0010-8000-00AA006D2EA4} 2.5:{00000564-0000-0010-8000-00AA006D2EA4}:'Microsoft ActiveX Data Objects 2.5 Library'.Fields"; Field@1000000012 : Automation "{00000205-0000-0010-8000-00AA006D2EA4} 2.5:{00000569-0000-0010-8000-00AA006D2EA4}:'Microsoft ActiveX Data Objects 2.5 Library'.Field"; ItemIndex@1000000008 : Variant; ItemVal@1000000007 : Variant; BEGIN CLEARALL ; IF ISCLEAR(Mail) THEN CREATE(Mail) ; Config := Mail.Configuration ; Fields := Config.Fields ; ItemIndex := 'http://schemas.microsoft.com/cdo/configuration/SendUsing' ; ItemVal := '2' ; Field := Fields.Item(ItemIndex) ; Field.Value := ItemVal ; ItemIndex := 'http://schemas.microsoft.com/cdo/configuration/smtpserver' ; ItemVal := SMTPServer ; Field := Fields.Item(ItemIndex) ; Field.Value := ItemVal ; ItemIndex := 'http://schemas.microsoft.com/cdo/configuration/smtpserverport' ; ItemVal := '25' ; Field := Fields.Item(ItemIndex) ; Field.Value := ItemVal ; ItemIndex := 'http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout' ; ItemVal := '1' ; Field := Fields.Item(ItemIndex) ; Field.Value := ItemVal ; Fields.Update ; Mail.From := From ; Mail.Sender := Sender ; Mail."To" := RcpTo ; Mail.CC := Cc ; Mail.BCC := Bcc ; Mail.Subject := Subject ; IF NOT ISCLEAR(HTMLBody) THEN Mail.HTMLBody := HTMLBody ELSE Mail.TextBody := TextBody ; Mail.Send ; CLEARALL ; END;
IF CurrExchangeRate.INSERT THEN BEGIN HTMLBody := HTMLBody + '<b>' + CurrExchangeRate."Currency Code" + '</b>(' +CurrExchangeRate.ISO+') - 1 EUR='+ FORMAT( CurrExchangeRate."Exchange Rate Amount" ) + '<p>' ; END ; ... ... SendSMTP('me','me@company.si','cc@company.si','me@company.si','', 'mail.company.si','Exchange rates for '+FORMAT(CurrExchangeRate."Starting Date")+' are imported'),HTMLBody,'') ;
Comments
In common mail you can try to add character '\' as a new line...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Try this, it is not last version, but you'll find out the way.
I'm using this for notification of sucessfull import of exchange rates.