Sending mail from Excel with CDO

Eine Möglcihkeit um aus Excel, per VBA, Emails zu versenden sieht so aus:

Sub CDO_Mail_Small_Text()
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/sendusing“) = 2 ‚ .Item(„http://schemas.microsoft.com/cdo/configuration/smtpserver“) _ ‚ = „Fill in your SMTP server here“ ‚ .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 = „ron@debruin.nl“
.CC = „“
.BCC = „“
.From = „““Ron““ <ron@something.nl>“
.Subject = „New figures“
.TextBody = strbody
.HTMLBody= „<b>Hier</b> kommt dann evtl. html “
.Send
End With

End Sub

Hier geht es zum orginalen Artikel: Sending mail from Excel with CDO.