Outlook attachments

Q1970
Member Posts: 34
Hi,
I have this problem when using CU397. I call the function NewMessage, intending to both attach a file (PDF) to the mail, and to show the dialog so that I can add additional text to my mail.
The code:
MailSent := Mail.NewMessage('me@home.com','','Header','Body','C:\testfile.pdf',TRUE) ;
creates the mail beautifully, lets me add text and send it. In my Sent Mails folder in Outlook, the mail, including the attachment, is there just as it was when I sent it.
But the problem is this: The receiver doesn't run Outlook, and the attachment is unaccesible to him. Instead there is the this file called winmail.dat attached to the mail.
I read somewhere else on this board that I need to send the mail in plain text format, so in order to enforce plain text, I tried to change the line
OSendMail.BodyFormat := 2;
to
OSendMail.BodyFormat := 1;
Although the mail now registers as plain text, ufortunately the end result is still the same.
I also tried to set the "Compose message format" in Outlook to Plain Text. That didn't help me either.
If I set the OpenDialog parameter to FALSE, thereby auto-sending the mail without opening it first, then the receiver can read the attached file (in this case PDF) without any problems. Also, if I create a new mail in Outlook, attach the file and send it off, then everything works.
So, it seems that the only thing I want to do, is the only thing I can't do. Sounds strangely familiar, somehow. ](*,)
How can I work around this? Any ideas and suggestions will be greatly appreciated.
Thanks in advance.
/Q
EDIT: I run Navision 4.0 SP3 and Outlook 2003 SP2
I have this problem when using CU397. I call the function NewMessage, intending to both attach a file (PDF) to the mail, and to show the dialog so that I can add additional text to my mail.
The code:
MailSent := Mail.NewMessage('me@home.com','','Header','Body','C:\testfile.pdf',TRUE) ;
creates the mail beautifully, lets me add text and send it. In my Sent Mails folder in Outlook, the mail, including the attachment, is there just as it was when I sent it.
But the problem is this: The receiver doesn't run Outlook, and the attachment is unaccesible to him. Instead there is the this file called winmail.dat attached to the mail.
I read somewhere else on this board that I need to send the mail in plain text format, so in order to enforce plain text, I tried to change the line
OSendMail.BodyFormat := 2;
to
OSendMail.BodyFormat := 1;
Although the mail now registers as plain text, ufortunately the end result is still the same.
I also tried to set the "Compose message format" in Outlook to Plain Text. That didn't help me either.
If I set the OpenDialog parameter to FALSE, thereby auto-sending the mail without opening it first, then the receiver can read the attached file (in this case PDF) without any problems. Also, if I create a new mail in Outlook, attach the file and send it off, then everything works.
So, it seems that the only thing I want to do, is the only thing I can't do. Sounds strangely familiar, somehow. ](*,)
How can I work around this? Any ideas and suggestions will be greatly appreciated.
Thanks in advance.
/Q
EDIT: I run Navision 4.0 SP3 and Outlook 2003 SP2
0
Comments
-
Sounds mystical. Do you delete the file at some point?0
-
Mbad wrote:Sounds mystical. Do you delete the file at some point?
In my original code, I do actually delete the file. I suspected this to be the reason also, which was why I tried to call the default function with an attachement file, created in advance and never deleted. As you can see above, I got the same result
The difference seems (at least to me) to be whether or not the OpenDialog parameter is TRUE. As soon as the OpenDialog parameter is set to TRUE, then the non-outlook clients can't read the attachment. IF it's FALSE, there doesn't seem to be any problems for anybody, in reading the attachment.0 -
Did you try attaching an already created file so there is no possibility that the pdf driver is 'hanging'? And are you running on your local machine?
Damn these are long shots, but im outa ideas.0 -
Mbad wrote:Did you try attaching an already created file so there is no possibility that the pdf driver is 'hanging'? And are you running on your local machine?
Damn these are long shots, but im outa ideas.
Thanks for trying
The file was indeed one that I had created in advance. In a last desperate attempt I even tried to reboot after creating the file, before I called the function.
Both Navision and Outlook are running locally on my own PC here, so I don't think network issues can be blamed.0 -
Sounds like an issue with the Outlook client itself, possibly something to do with the MIME settings. Which version of Outlook? Are any of these non-Outlook clients using a Mac?
Try this. In Tools...Options, go to the Mail Format Tab, hit Internet Format, and try setting it to Convert to HTML Format if it is not already set to that. I would also make sure that you are not using Word as your e-mail editor, as that can cause some problems as well.There is no data, only bool!0 -
thaug wrote:Sounds like an issue with the Outlook client itself, possibly something to do with the MIME settings. Which version of Outlook? Are any of these non-Outlook clients using a Mac?
Try this. In Tools...Options, go to the Mail Format Tab, hit Internet Format, and try setting it to Convert to HTML Format if it is not already set to that. I would also make sure that you are not using Word as your e-mail editor, as that can cause some problems as well.
I'm using Outlook 2003 SP2
I'm not aware of any Mac-users. The problem arises even when I send the mails to my own hotmail account, or to my private email-adress which I set up with Thunderbird for the purpose of solving this problem. In both cases, the attached file seems to have been replaced with this "Winmail.dat" file instead. Could it be some sort of encoding/encryption issue?
I tried your suggestion (setting the Internet Format til HTML). But it was set to that setting already. Just to eliminate another issue, I tried to change that setting to "Plain text", but the problem still occurs. But still only when that ShowDialog parameter is set to TRUE when I call the function.
It baffles me greatly, especially since it works perfectly when I open Outlook manually, attach the very same file and send it off to the very same receipient. In my sent items, the mail looks exactly the same as the one which was created in Navision. But obviously there must be a difference, I just can't figure out what it is.
Thanks for your suggestion.
/Q0 -
I have done some further tests, and this has confirmed that everything works perfectly (including cases where the OpenDialog set to TRUE), as long as the receipient is also using outlook. But if (s)he isn't, then there will be a winmail.dat attached instead of the intended file.0
-
I have for 3-4 months had a lenghtly discussion with Microsoft about this issue - but they still haven't found the solution :-( I hope they keep looking for it.Mvh
Rolf Garde0 -
Hi everybody,
I've got a problem sending mails from nav trough outlook:
the code is something like this:
REPEAT
L_CodeUnitMail.NewMessage(Rec.E-Mail,'','hello world','',attachements,OPEN_DIALOG_PARAMETER)
UNTIL Rec.NEXT=0;
If I set the last parameter (open dialog) on TRUE all works, i.e. the dialog open and the mail can be sended.
But my customer want to send mails blindy and so I've tried to set the open dialog parameter on FALSE but in this case mails are not sended and the function L_CodeUnitMail.NewMessage return FALSE.
Has anybody an idea about the matter?
Thans in advice guys0
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