SMTP error (multiple recipients)

SilentpowerSilentpower Member Posts: 13
Hello,

I have a problem with the SMTP OCX automation.

When I want to sent an email from Navision using SMTP and the property addCCRecipients, the mail is perfectly sent to the sendTo address, but not to the CC addresses.
ocxSmtpMailXElement.NewMessage(lrecInterfaceSetup."SMTP From Email Address",precInterfaceApp."Error Email Subject");
ocxSmtpMailXElement.SetWorkMode();
ocxSmtpMailXElement.SetHost(lrecInterfaceSetup."SMTP Host");
ocxSmtpMailXElement.SetUserID(lrecInterfaceSetup."SMTP UserName");

ocxSmtpMailXElement.SetToAdress('info@schuer.be');
ocxSmtpMailXElement.AddCCRecipients('geert@schuer.be;jef@schuer.be');

  ocxSmtpMailXElement.AddLine(ptxtBody);

  IF precInterfaceApp."Add Errorfile As Attachment" THEN BEGIN
    IF FILE.EXISTS(ptxtFileName) THEN
      ocxSmtpMailXElement.AddAttachment(ptxtFileName);
  END;

  IF ocxSmtpMailXElement.Send THEN BEGIN
    IF NOT ocxSmtpMailXElement.WasSuccessful THEN BEGIN
      MESSAGE(ocxSmtpMailXElement.LastError);
    END;
  END ELSE BEGIN
    MESSAGE(STRSUBSTNO(errText006,lrecInterfaceSetup."SMTP Host"));
  END;


Any ideas?

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Maybe you need to write:
    ocxSmtpMailXElement.AddCCRecipients('geert@schuer.be');
    ocxSmtpMailXElement.AddCCRecipients('jef@schuer.be');
    
    ?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SilentpowerSilentpower Member Posts: 13
    ok, that's the solution!

    Tnx!
Sign In or Register to comment.