Ik heb deze site doorzocht en die van Ron de Bruin, maar ik kom er nog niet uit.
Graag wil ik de active.sheet mailen, en het adres halen uit een cel uit de active.sheet.
Ik gebruik geen Outlook en ook geen windows mail. Dus het moet puur met CDO met gmail.
Bij voorbaat dank!
Deze code heb ik tot nu toe, hoe moet deze worden als ik de active.sheet, in een email krijg?
Graag wil ik de active.sheet mailen, en het adres halen uit een cel uit de active.sheet.
Ik gebruik geen Outlook en ook geen windows mail. Dus het moet puur met CDO met gmail.
Bij voorbaat dank!
Deze code heb ik tot nu toe, hoe moet deze worden als ik de active.sheet, in een email krijg?
Sub CDO_Mail_Small_Text_2()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = ".......@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "geheim natuurlijk"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "............@hotmail.com"
.CC = ""
.BCC = ""
.From = """Jaap Tijssen"" <............@gmail.com>"
.Subject = "Important message"
.TextBody = strbody
.Send
End With
End Sub
Laatst bewerkt: