Hi,
I have a problem i could need some help with.
I have this code:
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
= "Myoutgoing"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
sq = Columns(2).SpecialCells(2).Offset(, -1).Resize(, 2)
Open "file:///C:/MyHtmlTemplate.html" For Input As #1
c01 = Input(LOF(1), #1)
Close #1
For j = 1 To UBound(sq)
Open "file:///C:/Temp/MyHtmlTemplate.html" & j & ".html" For Output As #1
Print #1, Replace(c01, "[userName]", sq(j, 1))
Close #1
With iMsg
Set .Configuration = iConf
.to = sq(j, 2)
.From = """You"" <you@mail.com>"
.Subject = "Subject"
.CreateMHTMLBody "file:///C:/Temp/MyHtmlTemplate.html" & j & ".html"
.Send
End With
Next
On Error Resume Next
Kill "C:/Users/Steffen/Documents/Data_til_mail_test/Mails/Skraldespand/*.*"
On Error GoTo 0
This goes threw a list of mails in my worksheet and sends them a personlaize mail of the template.
Now the problem is in my template i have a signature (Images).
when i send to multiple mailadresses the first gets the mail as expected, number 2 gets the mails as expected and an attached signature. number 3 gets 2 attached signatures.
It's seem the signature isn't killed after every send.
Any help?
Steffen Thomsen.
Bookmarks