Options

Mail.NewMessage(..)

jhanvincent14jhanvincent14 Member Posts: 214
Hello, Good day.

Why is Mail.NewMessage is sending 2 emails with the same message? is there any way on how to send 1 email using Mail.Message?

here is my code:
Mail.NewMessage(...);
Mail.Send;
MESSAGE('Mail Sent');

Answers

  • Options
    AluanAluan Member Posts: 162
    Hello jhanvincent14,

    are you using the Codeunit 397?
    If so, try it without Mail.Send.
  • Options
    jhanvincent14jhanvincent14 Member Posts: 214
    Aluan wrote: »
    Hello jhanvincent14,

    are you using the Codeunit 397?
    If so, try it without Mail.Send.

    Yes, I'm using it. still send 2 emails
  • Options
    AluanAluan Member Posts: 162
    So, you removed the line with "Mail.Send" but you get still 2 mails?
    Where are you using that code?

    If you only use the NewMessage function, you should only get one mail, cause the send function is only called once.
  • Options
    jhanvincent14jhanvincent14 Member Posts: 214
    Aluan wrote: »
    So, you removed the line with "Mail.Send" but you get still 2 mails?
    Where are you using that code?

    If you only use the NewMessage function, you should only get one mail, cause the send function is only called once.

    Hello @Aluan it works now, i follow what you said. thanks :) followup question, how mail.newmessage works? i mean, it sends email but to think that I didn't specify a From Address but still sends email.
  • Options
    AluanAluan Member Posts: 162
    In this case the currently registered Outlook user is used.
    If you open Outlook you should see the sent files in the "sent items" folder.

    If you don't have Outlook installed, it shouldn't work.
Sign In or Register to comment.