請問calc能使用cdo.message 發gmail信件嗎?

calc如何使用 巨集 發mail 謝謝

終於找到解決辦法

Option VBASupport 1

Sub Main
SendMail= CreateObject("CDO.Message")
ConfURL =  "http://schemas.microsoft.com/cdo/configuration/"

With SendMail.Configuration.Fields
        .Item( ConfURL & "smtpusessl" ) = true
        .Item( ConfURL & "smtpauthenticate" ) = 1
        .Item( ConfURL & "smtpserver" ) = "smtp.gmail.com"
        .Item( ConfURL & "smtpserverport" ) = 465
        .Item( ConfURL & "sendusing" ) = 2
        .Item( ConfURL & "sendusername" ) = "xxx@gmail.com"
        .Item( ConfURL & "sendpassword" ) =  "mail password"
        .Update
End With

With SendMail
  .Subject = "LibreOffice Calc 巨集發信測試"
  .From = "發信者電子郵件"
  .To = "收件者電子郵件"
  .HTMLBody = "LibreOffice Calc 巨集發信測試"
  .Send
End With

SendMail = nothing
End Sub