• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

vvMail questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vvMail questions

    Hi,
    I have a couple of vvMail questions:

    1. Can vvMail be able to send an email to multiple addresses.
    I have tried sending an email to multiple addresses (including multiple bcc) but the email only sent to the first person (not even including bcc).
    What should be the proper value to be loaded to vvMail data structure prior to calling vvMail_send?

    Here is the data I used:
    Code:
    dsMail.to: dleong@targetcorp.com
    dsMail.bcc: dleong@someaddress.com,first.last@gmail.com
    dsMail.from: dleong@srccorp.com
    dsMail.subject: TEST 7
    dsMail.body: <p>Test #7</p><br><p><img src="http://CELS7/Mailer/test/YearofLove_Clby.jpg"
     height="550" border="0" alt="YearofLove_Clby.jpg"></p>
    dsMail.attach: /tmp/0000000024YearofLove_Clby.jpg
    dsMail.alias: YearofLove_Clby.jpg
    2. Can I add an attachment to vvMail?
    I noticed that one can specify a path to a file (is image file ".jpg" a good candidate with vvMail?) for vvMail attachment.
    At first, I tried specifying a path via QNTC. It did not set the file as attachment. I thought it might be due to the quirky nature of QNTC, I then copied the image file from QNTC to a temp folder onto IFS and use this copy instead. As a result, the file did not get attached to the final email.
    The vvMail worked if I specified the image file as an embedded object via a HTML tag.

    Code:
      sBody = %trim(sBody)                                    
            + '<p><img src="'+%trim(dsMail.imagename)+'"'+    
              ' width="550"'+                                 
              ' height="550"'+                                
              ' border="0"'+                                  
              ' alt="'+%trim(sName)+'"></p>';                 
      vvMail.body = sBody;
    Overall, the vvMail worked except the above 2 problems I encountered.

  • #2
    Yes, you can send to multiple addresses using a comma separator, I just confirmed this works on our 4.2 instance. Did you check the spam folder on the gmail address? I notice Google is a bit over-zealous sometimes with its spam classification.

    Attachments should work for any type of file, you just need to specify a valid IFS path relative to the root. Check the Errors app to see if it's logging an "Attempted to attach a non-existent file to an email" error.

    Comment


    • #3
      I checked gmail account and could not find the email in spam.
      I did log the command in vvGenLog:

      HTML Code:
      SNDHTMLEML TOADDRS((TO 'dleong@celsinc.com' dleong@celsinc.com)) SUBJECT('test outside email') HTMLMSG('<p>this is a test to see if vvMail can send to an outside address</p><br><p><img src="http://CELS7/Mailer/test/YearofLove_Clby.jpg" width="550" height="550" border="0" alt="YearofLove_Clby.jpg"></p>')
      The command did not appear to have my "bcc" specified.

      Here's the code I used to generate that email:

      Code:
      dcl-ds dsEmail       qualified template;       
        to                 like(vvMail.to);          
        bcc                like(vvMail.bcc);         
        from               like(vvMail.from);        
        subject            like(vvMail.subject);     
        body               like(vvMail.body);        
        imageid            like(dsFile.IMGID);       
        imagename          like(dsFile.IMGNAME);     
        ibmuser            like(dsUser.VVIBMIUSER);  
        mailtype           char(1);                  
      end-ds;                                        
      
      dcl-ds dsMail        likeds(dsEmail) inz;               
                                                            
      dsMail.imagename = vvIn_Char('imageurl');             
      dsMail.imageid = vvIn_Num('imageid');                 
      dsMail.from    = vvIn_char('from');                   
      dsMail.subject = vvIn_char('subject');                
      dsMail.body    = vvIn_Char('body');                   
      dsMail.to  = vvIn_char('to');         
      dsMail.bcc = vvIn_char('bcc');        
      dsMail.mailtype = 'E';                
      
      nTrxId = getNextTrxId();      
      
      clear vvMail;                 
      eval-corr vvMail = dsMail;    
      
      sImage = getImageName(dsMail.imageid:'QNTC');             
      sName  = getImageName(dsMail.imageid:*omit:'Y');          
      sTmpName = '/tmp/'+%editc(nTrxId:'X')+%trim(sName);       
      runCmd('CPY OBJ('+enquote(sImage)+')'+                 
             ' TOOBJ('+enquote(sTmpName)+')');           
      vvMail.attachment = sTmpName;                           
      vvMail.attachAlias = sName;                             
      
      sBody = '<p>'+%trim(dsMail.body)+'</p><br>';               
      sBody = %trim(sBody)                                       
            + '<p><img src="'+%trim(dsMail.imagename)+'"'+       
              ' width="550"'+                                    
              ' height="550"'+                                   
              ' border="0"'+                                     
              ' alt="'+%trim(sName)+'"></p>';                    
      vvMail.body = sBody;                                       
      vvMail.separator = ',';                                    
      
      vvMail_send(vvMail);
      runCmd('DEL OBJLNK('+enquote(sTmpName)+')');
      Is there something I did not do correctly?

      Comment


      • #4
        Are you using an exit program to process emails sent through VVMAIL? I suspect you must be, based on that SNDHTMLEML command. Check your Portal Admin > Settings > Exit Programs > "VVMAIL, pre-processing".

        Comment


        • #5
          You are correct!
          We are using VXEMAIL as an exit program.

          V41ExitProgram.PNG

          I will need to find out what that does.

          Comment


          • #6
            Originally posted by robert.swanson View Post
            Are you using an exit program to process emails sent through VVMAIL? I suspect you must be, based on that SNDHTMLEML command. Check your Portal Admin > Settings > Exit Programs > "VVMAIL, pre-processing".
            It turns out that the version of vvMail on our boxes was not working, so our staff created an exit program to handle it.
            It looks like the vvMail in version 5 is very similar to version 4.1 (the version we are using).
            Perhaps we should open a service ticket with you to find out why vvMail is not working?

            Comment


            • #7
              If you're having trouble with VVMAIL it's most likely something to do with your IBM i SMTP setup, as VVMAIL is essentially just a wrapper to API calls that use that service.

              Comment

              Working...
              X