Sending mail - not working -

Resender
Member Posts: 119
Hello all,
Last week I had an assignment where an automatic mail had to be generated.
I tried both using the SMTP & Mail Codeunits.
I either got the error 0x80040213 The transport failed to connect to the server OR
the mail call succeeded but when going into the codeunit at the point where the mail object is to be initiated
the code just stops without an error.
I tried 3 different smtp setting
1)Of the company (both anonymous with my login credentials)
2)Of a public ISP (like gmail, hotmail)
3)Of the ISP of my home account (using login credentials from my account)
All had the same results
I also tried this on a machine with and one without an email client installed.
And in case of the email client I got the error message that the client was unable to do so because it was not set as the default email client, I then looked this error up and did what I've found but the error remained.
I'm currently no longer working on this but I like to know for myself what could have been the cause of this. And how to fix it cause it's been 'bugging' me.
Last week I had an assignment where an automatic mail had to be generated.
I tried both using the SMTP & Mail Codeunits.
I either got the error 0x80040213 The transport failed to connect to the server OR
the mail call succeeded but when going into the codeunit at the point where the mail object is to be initiated
the code just stops without an error.
I tried 3 different smtp setting
1)Of the company (both anonymous with my login credentials)
2)Of a public ISP (like gmail, hotmail)
3)Of the ISP of my home account (using login credentials from my account)
All had the same results
I also tried this on a machine with and one without an email client installed.
And in case of the email client I got the error message that the client was unable to do so because it was not set as the default email client, I then looked this error up and did what I've found but the error remained.
I'm currently no longer working on this but I like to know for myself what could have been the cause of this. And how to fix it cause it's been 'bugging' me.
0
Comments
-
There's no reason I know of that NAV would fail where another client (Outlook, etc.) set up the same way succeeds. So can't really help there. However, if you ever need to interactively send e-mails via NAV (or other app), and don't need to automatically add attachments, you can use the mailto URI. This doesn't actually send the e-mail, it just launches the default mail client, so it's not useful for sending automated alerts, etc.
To use this approach in NAV, create a variable of type automation with subtype'Windows Script Host Object Model'.WshShell
Then a few lines of code to send the e-mail:CREATE(oShell); oShell.Run('mailto:someguy@somedomain.com&subject=Hello%20There&body=This%20is%20the%20e-mail%20text'); CLEAR(oShell);
Note that you will likely need to escape the text - if you're in control of it, then you probably only need to worry about putting %20 in place of spaces.
Sorry I couldn't help with the original issue, but hopefully the mailto approach gives you some other options in the future.
- Mark0
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