My EShip came with a MAILOCX - lets try it!

Savatage
Member Posts: 7,142
Our EShip came with an email OCX. It can be used in the system to send mails if you don't want to use CU397 (for whatever reason)
the useable fields:
OnPush()
On Table 112 - to tell me who's trying to delete records!!
Just an FYI probably nobody else needs this 8)
the useable fields:
For example I tried it on a button on the item card that quickly creates an email of the item details and attaches a picture.MailOCX.LineFeedChar := '';
MailOCX.InitializeMail('Your Email Subject');
MailOCX.AddReceiverTo('youremail1-at-yourdomain.net');
MailOCX.AddReceiverCC('youremail2-at-yourdomain.net');
MailOCX.AddReceiverBCC('youremail3-at-yourdomain.net');
MailOCX.AddtoBody(FieldValue.SubstituteLine(EMailBodyLine));
MailOCX.AddAttachment(TempFilename);
MailOCX.Send(FALSE); //false = send automatically
OnPush()
User.GET(USERID); CALCFIELDS(Picture); IF Picture.HASVALUE THEN BEGIN EmailSubject := 'Please Update: Item '+"No."+' Picture Attached'; EmailBody := 'Item '+"No."+' Picture Attached'; TempFileName := 'P:\jpg\'+"No."+'.jpg'; MailOCX.LineFeedChar := ''; MailOCX.InitializeMail(EmailSubject); MailOCX.AddReceiverTo(User."User Email Address"); MailOCX.AddtoBody('Item#: '+"No."+'\'); //note baskslash forces new line in body MailOCX.AddtoBody(Description+' '+"Description 2"+'\'); MailOCX.AddtoBody('UPC: '+"Item UPC/EAN Number"); MailOCX.AddAttachment(TempFileName); MailOCX.Send(TRUE); //creates email but doesn't send until user sends END;
On Table 112 - to tell me who's trying to delete records!!
OnDelete() SendMail; SendMail() User.GET(USERID); MailOCX.LineFeedChar := ''; MailOCX.InitializeMail('Sales Invoice Deletion Attempt'); MailOCX.AddReceiverTo('youremail1-at-yourdomain.net'); MailOCX.AddReceiverCC('youremail2-at-yourdomain.net'); MailText := 'Date:'+FORMAT(TODAY)+' '+'Time:'+FORMAT(TIME)+' '+'User:'+FORMAT(User."User ID")+' '+'Invoice#:'+FORMAT("No."); MailOCX.AddtoBody(MailText); MailOCX.Send(FALSE); CLEAR(MailOCX);
Just an FYI probably nobody else needs this 8)
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