4 Replies Latest reply: May 23, 2016 9:24 AM by ramaraj M RSS

    Sending reports(excel) by email

      Hi!

      It works correctly , sends the mail without problems with this code:

      Sub SendGMail() 
      
      ' Object creation 
      Set objMsg = CreateObject("CDO.Message") 
      Set msgConf = CreateObject("CDO.Configuration") 
      
      ' Server Configuration 
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@gmail.com"  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"  
      msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1  
      msgConf.Fields.Update 
      
      ' Email 
      objMsg.To = "user@gmail.com"  
      objMsg.From = "fromuser@domain.com"  
      objMsg.Subject = "Test send with Gmail account" 
      objMsg.HTMLBody = "HTML/Plain text message." 
      objMsg.Sender = "Mr. Name" 
      
      Set objMsg.Configuration = msgConf 
      
      ' Send 
      objMsg.Send 
      
      ' Clear 
      Set objMsg = nothing 
      Set msgConf = nothing
      
      End Sub
      
      

       

       

      I added this to send an attachment :

      objMsg.AddAttachment "C:\qliksense\tabla.xls"

       

      And it works too but now I need to "type"/"insert" object(excel) into mail's body  QlikView table that I want, not attachment.

       

      Someone please help me ?? Thank you !