How to send mail with outlook from NAV5.0 on a button click

subedar
Member Posts: 7
Hi all
I have a form with some values. I need to send mail through outlook when i click on a button
name send mail.
My mail format is like this:
To - subedar.ali@abc.com
subject - revenue
Body -
Revenue : 40000.
RBs : 3000.
total : 7000.
I have a form with some values. I need to send mail through outlook when i click on a button
name send mail.
My mail format is like this:
To - subedar.ali@abc.com
subject - revenue
Body -
Revenue : 40000.
RBs : 3000.
total : 7000.
0
Comments
-
did you check the source behind the mail button on the, for example, customer card?Do you make it right, it works too!0
-
garak wrote:did you check the source behind the mail button on the, for example, customer card?
Thanks for reply
yes i have with the code like this on mail button
Recipients := 'punit.sharma@abc.com,subedar.ali@abc.com';
Mail.MailContCustVendBank(DATABASE::Customer,'BRSC00019',Recipients);
This is working fine, but here how can i manage my other values in mail body.
I want to use this code
SenderName := 'subedar.ali@abc.com';
SenderAddress := 'brijendra.singh@abc.com';
Recipients := 'punit.sharma@abc.com';
Subject := 'Please see the mail its imp';
In Body
'Total Employe :20
revenue :4000
SMTPMail.CreateMessage(SenderName,SenderAddress,Recipients,Subject,Body,HtmlFormatted);
i want to use this code ,even i am not getting any error but still i am anable to send mail
Plz help0 -
First thing is to check that SMTP server is setup correctly in form 409 (SMTP Mail Setup).
Then using codeunit 400 (SMTP Mail), the basic syntax goes something like this:SMTP.CreateMessage (‘My Name’,'fromemailaddress@somedomain.com','tosomeone@thierdomain.com',’Subject’,’Body’,TRUE); <-- This creates the message and allows a simple subject to be specified (subject) and a short body message (1024 characters if you modify the string lengths).SMTP.AppendBody('your text here'); <-- You can repeat this as many times as needed.SMTP.Send;Name ConstValue
HTMLNewLine <br>
HTMLNewParagraph <p>
FONTVerdana2 <FONT FACE="Verdana" SIZE="2">
FONTBold <b>
FONTBoldOff </b>
FONTItalicON <i>
FONTItalicOFF </i>
FONTUnderlineON <u>
FONTUnderlineOFF </u>
If you have a look at codeunit 400 you will see most of this and more functions for you to use
Dean.Remember: Keep it simple0
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