How to Send Emails through Code Unit
ckndr47
Member Posts: 100
Hi,
I want to send email through my code unit, but i dont want to use MS Exchange or Outlook for that; that means i want my code unit to send emails internally without using any tool like outlook.
Please provide me that OCX and also sample code if you have. I need to do tht in a very short time.
Thanks in Advance,
I want to send email through my code unit, but i dont want to use MS Exchange or Outlook for that; that means i want my code unit to send emails internally without using any tool like outlook.
Please provide me that OCX and also sample code if you have. I need to do tht in a very short time.
Thanks in Advance,
0
Comments
-
Hi,
I had the same problem a few months ago. So, I looked around and I found a file blat.exe on www.blat.net. This is infact a smtp mailer which you can use for free. I even changed my mail codeunit so that this file is allways used instead of outlook. It works very fine and very quickly.0 -
Check this link http://www.mibuso.com/forum/viewtopic.php?t=3475Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
I am using ocx provided by SMTP Mail v1.6 - Stabilized.
But that email stuff is not working; i am unable to figure out what exactly the problem is becuase with same SMTP Host name i am sending emails from my webbased application and its working fine. But over here i have no clue. This is wht i have written inside my codeunit, please guide me up if i am missing out anything.smtp.NewMessage('me@mysmtpdomain.com','Testing'); smtp.SetToAdress('testuser@test.com'); smtp.SetFromAdress('me@mysmtpdomain.com'); smtp.SetHost('MYHOSTNAME'); smtp.Send(); MESSAGE('%1',smtp.Send()); // this message is returning NO MESSAGE('%1',smtp.WasSuccessful()); // this message is returning YES MESSAGE('%1',smtp.LastError()); // this message is return nothing
Thanks in Advance0 -
ckndr47 wrote:I am using ocx provided by SMTP Mail v1.6 - Stabilized.
But that email stuff is not working; i am unable to figure out what exactly the problem is becuase with same SMTP Host name i am sending emails from my webbased application and its working fine. But over here i have no clue. This is wht i have written inside my codeunit, please guide me up if i am missing out anything.smtp.NewMessage('me@mysmtpdomain.com','Testing'); smtp.SetToAdress('testuser@test.com'); smtp.SetFromAdress('me@mysmtpdomain.com'); smtp.SetHost('MYHOSTNAME'); smtp.Send(); MESSAGE('%1',smtp.Send()); // this message is returning NO MESSAGE('%1',smtp.WasSuccessful()); // this message is returning YES MESSAGE('%1',smtp.LastError()); // this message is return nothing
Thanks in Advance
You have to set few more parameters...
On a example from http://www.nowecor.de/users/stephan/ind ... mtpocx.htm
here is a minimum of coding for successfull email sending (at least it worked for me).SMTPMail.NewMessage('stephan.stapel@tu-clausthal.de','Subject of the mail'); SMTPMail.SetWorkMode(); SMTPMail.SetHost('gb'); SMTPMail.SetUserID('coolesau'); SMTPMail.AddLine('This is a test.'); SMTPMail.AddLine('The second line.'); SMTPMail.AddLine('Third line'); SMTPMail.AddAttachment('c:\test.txt'); SMTPMail.SetToAdress('stephan.stapel@tu-clausthal.de'); SMTPMail.Send; IF NOT SMTPMail.WasSuccessful THEN MESSAGE(SMTPMail.LastError);
As you can see, you missed SetUserID parameter (which is required) and if you are testing, you should at least put one line of text (body)0 -
We are using it at a customer and it works fine.
The code we use is like this:ocxSmtpMailXElement.NewMessage("E-Mail Address","Subject"); ocxSmtpMailXElement.SetWorkMode(); ocxSmtpMailXElement.SetHost("Email Host"); ocxSmtpMailXElement.SetUserID("E-Mail User ID"); ocxSmtpMailXElement.AddLine("Body Line"); ocxSmtpMailXElement.SetToAdress("To email"); ocxSmtpMailXElement.AddCCRecipients("CC email"); ocxSmtpMailXElement.AddBCCRecipients("BCC email"); ocxSmtpMailXElement.AddAttachment("Filename"); ocxSmtpMailXElement.Send; IF NOT ocxSmtpMailXElement.WasSuccessful THEN BEGIN END;Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks a million, both codes are working fine.
So nice of you.
Regards,0 -
I'm having trouble to send mail with this OCX but with From parameter .
I must give it only real mail address (something@something.com). I SMTP communication I can give in a header a "From: My Name <somethin@something>" line and with that I can send mail with more descriptive From field...
Has anybody managed to send a more descriptive From field with this OCX?0 -
Interesting post Phenno
I have tried the same over here just for testing purpose and its not working. [/b]0 -
ckndr47 wrote:Interesting post Phenno
I have tried the same over here just for testing purpose and its not working. [/b]
well, I have to say that, althought it's working perfectly what it should work, lack of options gives me no other option than to search for another solution. Or to turn on a Delphi and update ocx
0 -
lack of options gives me no other option than to search for another solution
Allright then do update :P, if you find any other solution .
Thanks0 -
Once again, look at http://www.blat.net/syntax/syntax.html. This utility has much options.0
-
fl wrote:Once again, look at http://www.blat.net/syntax/syntax.html. This utility has much options.
Thx, I appriciate that.0 -
Dear All,,,
I have an error message exist "SMTP error. Error number 10061" when I use SMTP Mail v1.6 - Stabilized and the same code; Can any body help me to fix this problem???
Regards
Master Navision Developer0 -
Same error!
After years working fine with the OCX, today I have 2 new clients that give me the "SMTP error. Error number 10061", but same codeunit works fine in other computers!! ](*,)
Where is the error?
(EDIT) : I use smtpmailxcontrol 1.6 stabilized
Thanks0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
