MAPI Handler to SMTP

ivanl
Member Posts: 6
I need to change our bulk email code from MAPI to SMTP. When we send bulk emails from Navision Outlook pops up a message for each email. From what I understand I need to change the code from MAPI to SMTP. Unfortunately I am still learning the code but I need to make the changes.
Can anyone help me with this.
I need to change the code below with SMTP.
NewMessage(ToName : Text[80];CCName : Text[80];Subject : Text[260];Body : Text[260];AttachFileName : Text[260];OpenDialog : Boolean) Ma
IF ISCLEAR(MAPIHandler) THEN
CREATE(MAPIHandler);
ErrorNo := 0;
MAPIHandler.ToName := ToName;
MAPIHandler.CCName := CCName;
MAPIHandler.Subject := Subject;
IF Body <> '' THEN
MAPIHandler.Body := Body;
MAPIHandler.AttachFileName := AttachFileName;
MAPIHandler.OpenDialog := OpenDialog;
MailSent := MAPIHandler.Send;
ErrorNo := MAPIHandler.ErrorStatus;
AddBodyline(TextLine : Text[260]) : Boolean
IF ISCLEAR(MAPIHandler) THEN
CREATE(MAPIHandler);
IF TextLine <> '' THEN
EXIT(MAPIHandler.AddBodyText(TextLine));
Send() MailSent : Boolean
MailSent := MAPIHandler.Send;
ErrorNo := MAPIHandler.ErrorStatus;
GetErrorCode() : Integer
EXIT(MAPIHandler.ErrorStatus);
GetErrorDesc() : Text[260]
EXIT(MAPIHandler.ErrorDescription);
Can anyone help me with this.
I need to change the code below with SMTP.
NewMessage(ToName : Text[80];CCName : Text[80];Subject : Text[260];Body : Text[260];AttachFileName : Text[260];OpenDialog : Boolean) Ma
IF ISCLEAR(MAPIHandler) THEN
CREATE(MAPIHandler);
ErrorNo := 0;
MAPIHandler.ToName := ToName;
MAPIHandler.CCName := CCName;
MAPIHandler.Subject := Subject;
IF Body <> '' THEN
MAPIHandler.Body := Body;
MAPIHandler.AttachFileName := AttachFileName;
MAPIHandler.OpenDialog := OpenDialog;
MailSent := MAPIHandler.Send;
ErrorNo := MAPIHandler.ErrorStatus;
AddBodyline(TextLine : Text[260]) : Boolean
IF ISCLEAR(MAPIHandler) THEN
CREATE(MAPIHandler);
IF TextLine <> '' THEN
EXIT(MAPIHandler.AddBodyText(TextLine));
Send() MailSent : Boolean
MailSent := MAPIHandler.Send;
ErrorNo := MAPIHandler.ErrorStatus;
GetErrorCode() : Integer
EXIT(MAPIHandler.ErrorStatus);
GetErrorDesc() : Text[260]
EXIT(MAPIHandler.ErrorDescription);
0
Comments
-
You need to use a different automation program to send mails using SMTP.
You can download some free smtp-mailers or an smtp-ocx from this site to use in Navision:
SMTP Mail v1.6 - Stabilized
SMTP OCX v1.6No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Hi
You are wrong. MAPI is a DLL which we can use to send mail easyly. SMTP is a mail server.
Until Navision 4, the mail codeunit (397) use MAPI to send mails. In Navision 4, Navision has created an own DLL called OLHANDLER.DLL who use Microsoft outlook tecnology to send mails.
The problem about the popup message is not from Navision. The problem is Microsoft Oultlook. Tho avoid spam messages, its security filter are stronger, and you must erase it .There are some posibilities:
If you are using Navision 3.60,3.70, you don't need to change any code. You must change your Mail client from Microsoft outlook to Microsoft Outlook Express and configure the last one as your default mail app.
If you are using Navision 4, you must change codeunit 397 and your mail client.
If you use Exchange server as your mail server (Navision version is not important), you can use security templates to avoid this message. I done it and now works fine. Other people, have some problem with this template and has installed a free program who detects this message and answer it automaticaly. Search in the forum. There are a lot of information
http://www.mibuso.com/forum/viewtopic.p ... ht=outlook
Bye0 -
Thank you for all the replies.
We have set Outlook Express as our default mail app and unticked the checkbox in Outlook Express (Tools -> Options -> Security -> Warn me when other applications try to send mail as me)
We are using version Navision Attain 3.10 which should still be similar to 3.6 and 7.0 -
Hi Everyone,
The links on previous discussions didn't help me.
Do I need to change the code unit 397 when we use Outlook Express with a SMTP server on Navision 3.10?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions