title: Send an Email using PowerPoint VBA
body: <p>I want to send an email (with subject, body...) to another email address.
  I tried the following code, but it didn't work:</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
      Dim ret As Boolean
      Dim strAddress As String
      Dim strMessage As String
  
      strAddress = "examplemail@gmail.com"
      ret = SendEMail(strAddress, (Label1.Caption), strMessage)
      Label1.Caption = ret
  
      If Label1.Caption = "True" Then
          MsgBox "Mail sent!"
      ElseIf Label1.Caption = "False" Then
          MsgBox "Mail not sent!"
      End If
  
  End Sub
  
  
  Public Function SendEMail(strRecipient As String, strSubject As String, strBody As String) As Boolean
  
      Dim oApp As Object
      Dim oMail As Object
  
      Err.Clear
      On Error Resume Next
  
      Set oApp = GetObject(Class:="Outlook.Application")
      If Err &lt;&gt; 0 Then Set oApp = CreateObject("Outlook.Application")
      Err.Clear
      Set oMail = oApp.CreateItem(0)
      With oMail
          .Subject = strSubject
          .To = strRecipient
          'copy to self
          .CC = "youraddy@you.com"
          .BodyFormat = 1
          .Body = strBody
          .Send
      End With
  
      'cleanup
      Set oMail = Nothing
      Set oApp = Nothing
  
      'All OK?
      If Err = 0 Then SendEMail = True Else SendEMail = False
  
  End Function
  </code></pre>
  
  <p>The code was originally taken from <a href="http://www.pptalchemy.co.uk/PowerPoint_Email.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>If it is possible, I want a code that is compatible with most PCs.</p>