Need to send email to multiple email address using mail merg

Posted by singh.mitesh@gmail.com on 15-Apr-2015 16:11

Hello ,We are using the WORDMAILMERGE to send a word document to clients.  The problem is the we are able to send the document to only one email address at a time  properly . If we try to send the same document again to another email address (after it is sent to the first) , it sends the mail twice to the second email address. Below is the code for your reference .

/***some code******/ 

/* Open the DataSource and link it to the Active Document */
    hLink:MailMerge:OpenDataSource(fData) NO-ERROR.
    if error-status:error THEN do:
      fStat = "E Could not open Data Source " + fData + " " + fLink + ".".
      leave main.
    end.

    hLink:MailMerge:Destination = fDest NO-ERROR.    /* Set merged output destination */
    if error-status:error THEN do:
      fStat = "E Could not open New Destination " + string(fDest) + ".".
      leave main.
    end.
   
    if fMergex begins "E" then do:
      hLink:MailMerge:Destination = 2.      /* wdsendtoemail */
      hLink:MailMerge:MailSubject = fTitlex.
      hLink:MailMerge:MailAddressFieldName = "xmerge".
    end.
    hLink:MailMerge:Execute() no-error.     /* Execute the merge */

    if fMergex begins "E" then do:
      hLink:MailMerge:Destination = 2.      /* wdsendtoemail */
      hLink:MailMerge:MailSubject = fTitlex.
      hLink:MailMerge:MailAddressFieldName = "xmerge1".
    end.
    hLink:MailMerge:Execute() no-error.     /* Execute the merge */ 

 In the code above the first "  hLink:MailMerge:MailAddressFieldName = "xmerge". " sends one mail to the first reciepent , which is fine . But the second   "hLink:MailMerge:MailAddressFieldName = "xmerge1"."  send two mail to the receipent with respect to "xmerge1".

Please suggest , any help is appreciated . Thanks .

 

 

Posted by Evan Bleicher on 20-Apr-2015 07:22

Your question may be more specific to the WORDMAILMERGE utility rather than the ABL used to drive this functionality and therefore you may also want to consider posting your question to WORDMAILMERGE forums as well.

Evan Bleicher

All Replies

Posted by Evan Bleicher on 20-Apr-2015 07:22

Your question may be more specific to the WORDMAILMERGE utility rather than the ABL used to drive this functionality and therefore you may also want to consider posting your question to WORDMAILMERGE forums as well.

Evan Bleicher

Posted by singh.mitesh@gmail.com on 01-May-2015 09:13

Thanks Evan .. the issue is resolved . It was other setting in my application due to which it was sending two mails. Appreciate your help and Time .

Posted by blichal on 03-May-2015 03:07

you could also try the free docxfactory project and smtpmail.p

it would be alot more powerful, faster and you could run it on unix/linux.

This thread is closed