Mail in Drafts

AlishaAlisha Member Posts: 217
Hello,

I'm trying to automatically send an e-mail using the codeunit Mail and Outlook, but the message goes to Drafts. Anyone knows why?

Thanks

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Did you put the send option to TRUE ?

    Otherwise it will just leave it in drafts.
  • AlishaAlisha Member Posts: 217
    I'm using the function

    MailSent := mail.NewMessage(ToName,CCName,Subject,Body,AttachFileName,OpenDialog)

    where should I indicate the option SEND?

    The message is sent, but it remains in Drafts.
  • BlackBirdBlackBird Member Posts: 52
    I've noticed the same behaviour. I have been using the function NewMessage in cdu 397 since version 3.60 and in version 4.0 SP2 (I haven't tested all 4.0-versions) this function behaves differently like Alisha found out: mails are not send (or at least placed in Oubox) but remain in de Draftsfolder.
    I'm not sure what Mark means by putting the Send option to TRUE, because i don't think that you can do this in this function.
    I have send this as a request to Microsoftsupport.

    I'll let you know.

    Hans
  • AlkroAlkro Member Posts: 115
    Anybody have solved this?
  • BlackBirdBlackBird Member Posts: 52
    According to Microsoft:

    An Outlooksetting causes this behaviour. In Outlook select Tools, Options, E-Mail Options, Advanced E-Mail Options.
    You can now choose the default folder for unsent mail.

    When sending mail from Navision through Cdu 397 (Mail) this setting is used.
    If you have the setup so that unsent mail goes into the draft folder then irrespective of this , within 2 seconds it is passed to the Sent Items folder.
    It only waits in the 'draft' folder for a short time.

    Hans
  • ashash Member Posts: 1
    As I notised, mail stays in drafts folder only if you are using specific versions of Outlook.

    If my thoughts are correct, you won't see this error on Office XP, Office 2003 SP2 (and maybe prior versions).

    Maybe it's all because of OLHandler.dll, unfortunately can't say for sure.
  • StuAllenStuAllen Member Posts: 12
    Does any one have any more ideas on this?

    I've encoutered the same problem.

    Using Outlook 2003 the email goes to Drafts for a few seconds then gets moved to Sent Items but using Outlook 2007 the email is sent but remains in the Drafts folder.

    Originally the code was written in 4.01 but I've tried it using v5 with the same effect.
  • BlackBirdBlackBird Member Posts: 52
    Microsoft released a new version of the OLHandler.dll for this. According to my information this new dll should be available in 5.0, but i haven't tested it yet.

    Hans
  • TimSmithTimSmith Member Posts: 36
    I found this when doing some testing on some work I had recently completed.

    On investigation i found that going into my outlook options>Mail set up>set up email accounts and directories>view or change existing account>select the account and change

    There is a setting there... Use cached exchange mode.

    When ticked my mails go into draft, when unticked they are sent immediately #-o

    Took a bit of working out.....but I found it by comparing an email account that worked and mine.

    Tim
Sign In or Register to comment.