Hello,
I have an adresslist whom I want to mail a webpage (or better: the email should have a HTMLbody with pics and everything). This webpage should be the body of the e-mail (through Outlook). I've created some code to send the mails from Excel, but don't know how to create the bodytext.
Any suggestions?
Code so far:
Sub MailfromExcel()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
'//Emailadres in kolom A
For Each cell In Sheets("Memberlist").Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Offset(0, 0).Value <> "" Then '//If empty do not select
If cell.Offset(0, 0).Value = "TRIGGER" Then '//If cells contains text 'trigger' then mail
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Offset(0, 17).Value '//Outlook adres
.CC = cell.Offset(0, 16).Value '//email adres
.Subject = "//Uw inlogcode voor de Golfsite//"
'//////here do I want to select the html code etc////
.Send
'//.Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub
I have an adresslist whom I want to mail a webpage (or better: the email should have a HTMLbody with pics and everything). This webpage should be the body of the e-mail (through Outlook). I've created some code to send the mails from Excel, but don't know how to create the bodytext.
Any suggestions?
Code so far:
Sub MailfromExcel()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
'//Emailadres in kolom A
For Each cell In Sheets("Memberlist").Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Offset(0, 0).Value <> "" Then '//If empty do not select
If cell.Offset(0, 0).Value = "TRIGGER" Then '//If cells contains text 'trigger' then mail
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Offset(0, 17).Value '//Outlook adres
.CC = cell.Offset(0, 16).Value '//email adres
.Subject = "//Uw inlogcode voor de Golfsite//"
'//////here do I want to select the html code etc////
.Send
'//.Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub