This can be done. I have included some code below that sends an email from a gmail account (these settings should work for any gmail account). Settings for your specific SMTP server will be different. You can find information on the different available settings here: [https://msdn.microsoft.com/en-us/library/ms526318%28v=exchg.10%29.aspx][1]
MyResult = SendCDOMessage(''myemail@someplace.com'', ''mygmail@gmail.com'', ''Email Subject!'', ''Email Body!!'')
msgbox MyResult
Public Function SendCDOMessage(EmailTo, EmailFrom, EmailSubject, MessageBody)
Set oEmail = CreateObject(''CDO.Message'')
' Set message details
oEmail.Subject = EmailSubject
oEmail.Sender = EmailFrom
oEmail.From = EmailFrom
oEmail.To = EmailTo
oEmail.AutoGenerateTextBody = True
oEmail.HTMLBody = MessageBody
' Set configuration
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/smtpusessl'') = True
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/smtpauthenticate'') = 1
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/sendusername'')= EmailFrom
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/sendpassword'') = ''SetecAstronomy''
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/smtpserver'') = ''smtp.gmail.com''
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/sendusing'') = 2
oEmail.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/smtpserverport'') = 465
oEmail.Configuration.Fields.Update
' Send the message
oEmail.Send
If Err.Number <> 0 Then
SendCDOMessage = False
Else
SendCDOMessage = True
End If
Set oMessage = Nothing
End Function
[1]: https://msdn.microsoft.com/en-us/library/ms526318%28v=exchg.10%29.aspx